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

Animation Not Stopping Even After Stop Holding?

Okay.. So I scripted a animation for a cup and it works fine.. however, I don't understand why it still plays it when I click even when I'm not holding the cup. Please help!

1 answer

You didn't even paste your code, but I can take an educated guess as to what's happening. You have the tool, and you set a local script for when MouseButton1Down, it plays the animation. The thing is, you have to check if the cup is equipped! The simplest thing to do is to check if the cup tool's parent is a Player's character!

2 comments

0

It is equipped and you are correct about the MouseButton1Down script. But how to make the cup's parent the Player's character?

0

player = game.Players.LocalPlayer mouse = player:GetMouse() animation = script:WaitForChild("Animation") enabled = true mouse.Button1Down:connect(function() if enabled then enabled = false local animationTrack = player.Character.Humanoid:LoadAnimation(animation) animationTrack:Play() wait(3) enabled = true animation:Stop() end end)

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