Tool
Inherits from DynamicInstance
Tools are objects that can be held by players.
Summary
Properties
Droppable:bool
Methods
Play:void
Events
Activated:voidDeactivated:voidEquipped:voidUnequipped:void
Properties
Droppable
Tool.Droppable: bool
Determines whether the tool can be dropped by the player or not.
Example
tool.Droppable = true
Methods
Play
Tool:Play(animationName: string)
Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
animationName | string | - |
Plays an animation on the tool or the player that is currently holding the tool.
Example
local tool = script.Parent
tool.Activated:Connect(function()
tool:Play("slash")
end)
You can use the following emotes on these tools:
slash, eat, and drink.Properties
Events
Activated
Tool.Activated()
Fires when the user clicks while holding the tool.
Example
tool.Activated:Connect(function()
print("Tool has been activated!")
end)
Deactivated
Tool.Deactivated()
Gets fired when the user lets go of the mouse button while holding the tool.
Equipped
Tool.Equipped()
Fired when the tool is equipped.
Unequipped
Tool.Unequipped()
Fired when the tool is unequipped.