Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I make an animation play through a tool?

Im trying to make a restaurant and I want to know something: When a character is holding some food, how do I get the character to "eat" it? I already have the animation made, I just dont know how to put it into the tool, or the "food." I just want the animation to be played when you left-click while the food is equipped.

Anyone know how to do this?

1 comment

0

just say an if statement if the tool is equipped, for example: if tool.Equipped = true then anim:play() something like that

1 answer

This is obviously not the final product, but a concept that you could work off of to make your animation function when the player has the tool equipped and activated.

Basically, you just check if the tool is activated and then play the animation you want if it is. ROBLOX has a built-in function that if a tool is equipped and the player clicks their mouse, the tool is activated.

function toolActivated()
    animation:play()
    --eating functions etc
end
 
tool.Activated:Connect(toolActivated)

This discussion is preserved as it was. New answers, comments, and votes are closed.