Tools are Items players can equip and use.
They often live under StarterItems and are given to players when they join or respawn.
Inherits Instance.
Overview
Properties
- .Enabled : bool
- .RequiresHandle : bool
- .GiveOnJoin : bool
- .Preset : string?
- .preset deprecated : string?
Methods
- :Activate()
- :Deactivate()
Also inherits Instance methods.
Events
- .Equipped : Event (player: Player)
- .Unequipped : Event (player: Player)
- .Activated : Event (player: Player)
- .Deactivated : Event (player: Player)
API
Properties
Enabled
Enabled : bool
When false, the Tool cannot be equipped or used.
RequiresHandle
RequiresHandle : bool
When true, the Tool expects a child Part named Handle.
GiveOnJoin
GiveOnJoin : bool
When true (the default), players receive this Tool in their backpack when they join or respawn.
Uncheck it in Studio, or set it false in XML (<giveOnJoin>false</giveOnJoin>), to keep the Tool in StarterItems without giving it automatically.
Scripts can still grant it later with `Player:GiveTool`.
Place starter tools and GiveTool are not affected by catalog gear genre flags (workspace.AllowMelee, AllowRanged, AllowDestructive, AllowStealth, AllowBuilding, AllowConsumable). Those only filter catalog gears equipped in the avatar editor.
Preset
Preset : string?
Built-in preset name when this Tool comes from a Studio preset, or nil.
preset
preset deprecated : string?
Identical to Preset.
No longer recommended for use.
Methods
Activate
Activate() : void
Runs the Tool's activate behavior as if the player used it.
Deactivate
Deactivate() : void
Ends an active use of the Tool.
Events
Equipped
Equipped : Event (player: Player)
Triggers when a player equips the Tool.
tool.Equipped:Connect(function(player)
player:Notify("Equipped " .. tool.Name)
end)
Unequipped
Unequipped : Event (player: Player)
Triggers when a player unequips the Tool.
Activated
Activated : Event (player: Player)
Triggers when the Tool is used.
Deactivated
Deactivated : Event (player: Player)
Triggers when an active use of the Tool ends.
