This is the script I have right now, but it doesn't change the run animation when clicked. What am I doing wrong?
script.Parent.MouseButton1Click:connect(function(p) p.Character.Animate.run.RunAnim.AnimationId = "http://www.roblox.com/asset?id=1889592040" end)
local animation = Instance.new("Animation") animation.AnimationId = "http://www.roblox.com/asset?id=1889592040" script.Parent.MouseButton1Click:connect(function() local animTrack = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(animation) animTrack:Play() end)
I stole the scripting from the Roblox wiki, so I'm not 100% sure it'll work.
I fixed it, this should work:
script.Parent.MouseButton1Click:connect(function(p) local AnimationId = "1889592040" --set animation id here local Anim = Instance.new("Animation") Anim.AnimationId = "rbxassetid://"..AnimationId local k = p.Character.Humanoid:LoadAnimation(Anim) k:Play() k:AdjustSpeed(2) --set animation speed here end)
Tell me if it's broken or not.