Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Animation Not Stopping Even After Stop Holding? [closed]

Asked by 7 years ago

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!

Closed as Not Constructive by RubenKan and Goulstem

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
7 years ago
Edited 7 years ago

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!

0
It is equipped and you are correct about the MouseButton1Down script. But how to make the cup's parent the Player's character? wolfbarrier123 -25 — 7y
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) wolfbarrier123 -25 — 7y
Ad