Class · inherits BackpackItem
Tool
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.Enabled
: booleanRelates to whether or not the tool can be used.The Enabled property relates to whether or not the
Toolcan be used. This is useful if you want to prevent a player from using a tool, but don't want to remove it from theirBackpack.When set to
true, the player can use the tool. When set tofalse, the tool is disabled and the player cannot use it; this prevents the tool from being activated or deactivated by theTool.ActivateandTool.Deactivatemethods, and it prevents theTool.ActivatedandTool.Deactivatedevents from firing.GripForward
: Vector3HiddenNotReplicatedRepresents theR02,R12, andR22values of the gripCFramerotation matrix.One of the properties that specifies a tool's orientation in a character's hand. This represents the
R02,R12, andR22values of the gripCFramerotation matrix.Other tool properties that control how a character holds a tool include
Tool.GripUp,Tool.GripRight, andTool.GripPos. All of these properties are stored in a singleCFramein theTool.Gripproperty.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, andTool.GripForward. All of these properties are stored in a singleCFramein theTool.Gripproperty.GripRight
: Vector3HiddenNotReplicatedRepresents theR00,R10, andR20values of the gripCFramerotation matrix.One of the properties that specifies a tool's orientation in a character's hand. This represents the
R00,R10, andR20values of the gripCFramerotation matrix.Other tool properties that control how a character holds a tool include
Tool.GripUp,Tool.GripForward, andTool.GripPos. All of these properties are stored in a singleCFramein theTool.Gripproperty.GripUp
: Vector3HiddenNotReplicatedRepresents theR01,R11, andR21values of the gripCFramerotation matrix.One of the properties that specifies a tool's orientation in a character's hand. This represents the
R01,R11, andR21values of the gripCFramerotation matrix.Other tool properties that control how a character holds a tool include
Tool.GripRight,Tool.GripForward, andTool.GripPos. All of these properties are stored in a singleCFramein theTool.Gripproperty.ManualActivationOnly
: booleanControls whether theToolcan be activated without executingTool.Activate.This property controls whether the
Toolcan be activated without explicitly executingTool.Activatein a script.When set to
true, the tool will only fireTool.ActivatedwhenTool.Activateis called. This also suppresses theContextActionService.BindActivatefunction.When set to
false, mouse clicks (when the tool is equipped) will also fireTool.Activated.RequiresHandle
: booleanDetermines whether aToolfunctions without a handle.This property determines whether a
Toolfunctions 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 tofalse, 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
Mousehovers over theToolin theirBackpack.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
Events 4
Activated
Tool.Activated:Connect(function())Fires when the player clicks while the tool is equipped.This event fires when the player clicks while the
Toolis 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'sBackpackand prints "Tool activated" when the player clicks while the created tool is equipped.Deactivated
Tool.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
Toolis 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'sBackpackand prints "Tool deactivated" when the player releases their click while the tool is equipped and activated.Equipped
Tool.Equipped:Connect(function(mouse))Fires when the tool is equipped.This event fires when a player equips the
Tool(takes it out of theirBackpack).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.RequiresHandleis enabled and no handle is present.Unequipped
Tool.Unequipped:Connect(function())Fires when the tool is unequipped.This event fires when a player unequips the
Tool(puts it in theirBackpack).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.RequiresHandleis 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.