Skip to content

Class · inherits BackpackItem

Tool

Official docs ↗

An object, such as a weapon, that can be equipped by a Humanoid.

About Tool

A Tool is an object that a Humanoid object can equip. For players, they are stored in a Backpack object parented to a Player object. In-experience, players may have multiple tools which appear as icons at the bottom of the screen. Equipping a tool moves it from the Backpack and into a Player.Character model in the Workspace. By default, tools are held in the right hand and have a handle in them, which is a BasePart named Handle inside (although one isn't required if Tool.RequiresHandle is false). Tools that are to be provided to (re)spawning players should be stored in the StarterPack.

Properties 10

  • CanBeDropped: booleanControls whether the player can drop the tool.

    The CanBeDropped property controls whether the player can drop the Tool.

    If true, when the backspace button is pressed, the tool will be parented to Workspace and removed from the player's Backpack. If false, nothing will happen when backspace is pressed, and the tool will remain equipped.

  • Enabled: booleanRelates to whether or not the tool can be used.

    The Enabled property relates to whether or not the Tool can be used. This is useful if you want to prevent a player from using a tool, but don't want to remove it from their Backpack.

    When set to true, the player can use the tool. When set to false, the tool is disabled and the player cannot use it; this prevents the tool from being activated or deactivated by the Tool.Activate and Tool.Deactivate methods, and it prevents the Tool.Activated and Tool.Deactivated events from firing.

  • Grip: CFrameStores the tool's "grip" properties as one CFrame.

    The Grip property stores the tool's "grip" properties as a single CFrame. These properties position how the player holds the tool and include GripUp, GripRight, GripForward, and GripPos.

  • GripForward: Vector3HiddenNotReplicatedRepresents the R02, R12, and R22 values of the grip CFrame rotation matrix.

    One of the properties that specifies a tool's orientation in a character's hand. This represents the R02, R12, and R22 values of the grip CFrame rotation matrix.

    Other tool properties that control how a character holds a tool include Tool.GripUp, Tool.GripRight, and Tool.GripPos. All of these properties are stored in a single CFrame in the Tool.Grip property.

  • GripPos: Vector3HiddenNotReplicatedThe positional offset of the tool's weld matrix.

    This property controls the positional offset of the tool's weld matrix. It is one of several properties used to position how the player character holds the tool.

    Other properties that control how a character holds a tool include Tool.GripUp, Tool.GripRight, and Tool.GripForward. All of these properties are stored in a single CFrame in the Tool.Grip property.

  • GripRight: Vector3HiddenNotReplicatedRepresents the R00, R10, and R20 values of the grip CFrame rotation matrix.

    One of the properties that specifies a tool's orientation in a character's hand. This represents the R00, R10, and R20 values of the grip CFrame rotation matrix.

    Other tool properties that control how a character holds a tool include Tool.GripUp, Tool.GripForward, and Tool.GripPos. All of these properties are stored in a single CFrame in the Tool.Grip property.

  • GripUp: Vector3HiddenNotReplicatedRepresents the R01, R11, and R21 values of the grip CFrame rotation matrix.

    One of the properties that specifies a tool's orientation in a character's hand. This represents the R01, R11, and R21 values of the grip CFrame rotation matrix.

    Other tool properties that control how a character holds a tool include Tool.GripRight, Tool.GripForward, and Tool.GripPos. All of these properties are stored in a single CFrame in the Tool.Grip property.

  • ManualActivationOnly: booleanControls whether the Tool can be activated without executing Tool.Activate.

    This property controls whether the Tool can be activated without explicitly executing Tool.Activate in a script.

    When set to true, the tool will only fire Tool.Activated when Tool.Activate is called. This also suppresses the ContextActionService.BindActivate function.

    When set to false, mouse clicks (when the tool is equipped) will also fire Tool.Activated.

  • RequiresHandle: booleanDetermines whether a Tool functions without a handle.

    This property determines whether a Tool functions without a handle.

    A tool has a handle when it contains a child part named Handle. Tools with handles typically require the player equipping them to hold an object to use them, for instance weapons. Tools without handles typically don't require the player equipping them to hold anything to use them, for instance "fly" or "summon" tools.

    When set to true, the tool will function only with a handle. When set to false, the tool will function even without a handle.

  • ToolTip: stringControls the message displayed when the player's mouse hovers over the tool in their backpack.

    The ToolTip property controls the message that will be displayed when the player's Mouse hovers over the Tool in their Backpack.

    Generally, the value of this property should describe the what the tool is or its use. For instance, for a shovel tool, you may choose to set the ToolTip to:

    tool.ToolTip = "Shovel"
    

    or

    tool.ToolTip = "Use to dig"
    

    or

    tool.ToolTip = "Shovel - Use to dig"
    

Methods 2

  • Activate() → ()Simulates activation of the Tool.

    This function simulates activation of the Tool. The tool must be equipped for this function to work.

  • Deactivate() → ()Simulates deactivation of the Tool.

    This function simulates deactivation of the Tool. The tool must be equipped for this function to work.

Events 4

  • ActivatedTool.Activated:Connect(function())Fires when the player clicks while the tool is equipped.

    This event fires when the player clicks while the Tool is equipped. It is not fired if the Ctrl key is pressed during the click.

    This event is typically used to perform an action when the player uses the tool, for instance to launch a rocket from a rocket launcher weapon tool.

    The below code, when placed in a LocalScript, creates a tool in the local player's Backpack and prints "Tool activated" when the player clicks while the created tool is equipped.

  • DeactivatedTool.Deactivated:Connect(function())Fires when the player releases their click while the tool is equipped and activated.

    This event fires when the player releases their click while the Tool is equipped and activated. It is typically used to perform an action when the player stops using a tool.

    The below code, when placed in a LocalScript, creates a tool in the local player's Backpack and prints "Tool deactivated" when the player releases their click while the tool is equipped and activated.

  • EquippedTool.Equipped:Connect(function(mouse))Fires when the tool is equipped.

    This event fires when a player equips the Tool (takes it out of their Backpack).

    The opposite of this event, Tool.Unequipped, can be used to determine when the player unequips the tool by putting it in their backpack.

    Note that this event does not fire when Tool.RequiresHandle is enabled and no handle is present.

  • UnequippedTool.Unequipped:Connect(function())Fires when the tool is unequipped.

    This event fires when a player unequips the Tool (puts it in their Backpack).

    The opposite of this event, Tool.Equipped, can be used to determine when the player equips the tool by taking it out of their backpack.

    Note that this event does not fire when Tool.RequiresHandle is enabled and no handle is present.

Tool also has every member of BackpackItem. Deprecated and Roblox-only members are hidden.

Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.