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 4 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 — 4y
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 — 4y
0
I made an answer. Check it out and try it. youtubemasterWOW 2741 — 4y

1 answer

Log in to vote
0
Answered by 4 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.

workspace.Hello.ClickDetector.MouseClick:Connect(function(player)
    local animation = Instance.new("Animation")
    animation.AnimationId = “rbxassetid://04916278158"

    local loadedAnimation = player.Character.Humanoid:LoadAnimation(animation)
    loadedAnimation:Play()
end)
0
thank you this worked but for some reason the animation plays 3 times yoursoulsaver 5 — 4y
0
for anyone who was interested i solved with a wait() after the play yoursoulsaver 5 — 4y
Ad

Answer this question