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

I need help with my animations? They work in the studio but not in the game

here is the script

anime = script.Parent.name.Value

script.Parent.Selected:connect(function(m) m.Button1Down:connect(function() hum = game.Players.LocalPlayer.Character.Humanoid anim_feet = hum:LoadAnimation(script.Parent.Animation) current = anim_feet current:Play() end) end)

3 comments

0

Can you put your code in a code block

0

connect is deprecated. Use Connect.

0

HopperBins are deprecated. Use Tools with the RequiresHandle property set to false for a similar effect.

1 answer

Hello, fadinqkid!

I have written a script for you!

mouse = game.Players.LocalPlayer:GetMouse()
 Human = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")

 YourAnimation = script.Animation -- Place your animation inside the script, then change its name to Animation.

 AnimationPLAYER = Human:LoadAnimation(YourAnimation)

mouse.Button1Down:Connect(function()
Human.WalkSpeed = 0 -- Animations stop when a player moves, but now it doesn't ;)
Wait(1)
AnimationPLAYER:Play() -- Loop the animation, otherwise, it will stop.
end)

mouse.Button1Up:Connect(function() -- We don't want the animation to play forever, right?
Wait(1)
Human.WalkSpeed = 16
AnimationPLAYER:Stop()
end)

-- Good Luck!

---- AIphanium

1 comment

0

Only works with a LocalScript, and also, this script doesn't care if a tool is equipped or not.

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