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

help with running animations by clicking a part in the workspace?

Asked by 5 years ago

hello once again i am asking for help. i am trying to get a custom animation to run when the player clicks a part so far i have not been able to get anything to work. could someone help me?

0
Can you paste your script here? youtubemasterWOW 2741 — 5y
0
game.Workspace.Hello.ClickDetector.MouseClick:Connect(function(Player) local animation = Instance.new(“Animation”) animation.AnimationId = “http://www.roblox.com/Asset?ID=04916278158 local loadedAnimation = game.Workspace[player.Name].Humanoid:LoadAnimation(animation) loadedAnimation:Play() end)  yoursoulsaver 5 — 5y
0
I made an answer. Check it out and try it. youtubemasterWOW 2741 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

Looks like you forgot the other " at the end of the AnimationId property string. Also, I would use the built-in property, "Character", which is automatically in the player.

1workspace.Hello.ClickDetector.MouseClick:Connect(function(player)
2    local animation = Instance.new("Animation")
3    animation.AnimationId = rbxassetid://04916278158"
4 
5    local loadedAnimation = player.Character.Humanoid:LoadAnimation(animation)
6    loadedAnimation:Play()
7end)
0
thank you this worked but for some reason the animation plays 3 times yoursoulsaver 5 — 5y
0
for anyone who was interested i solved with a wait() after the play yoursoulsaver 5 — 5y
Ad

Answer this question