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

How would i make a character do a idle animation while a tool is out?

I created a weapon and an idle animation but whenever I want it to play while the character isn't moving, it plays but then it stops. I would like it if the animation kept playing over and over until the character has moved, though I wouldn't like that the character has it's arm sticking out when the tool is equipped

2 comments

0

just add a loop to it, then stop it when the character moves

0

HUH

1 answer

✓ Accepted answer

This is just an example, since you didn't show us the script, but you could do something like this with a while loop in a local script-

player = game.Players.LocalPlayer

IdleAnim = script:WaitForChild(Animation1) --this is assuming in the script you have the animation called Animation1

CanAnim = false

tool.Equipped:Connect(function)(IdleAnim)
CanAnim = true
end)

tool.Unequipped:Connect(function)(IdleAnim)
CanAnim = false
end)

while player.Walkspeed = 0 and CanAnim do 
player.Character.Humanoid:LoadAnimation(IdleAnim)

end)

It would be best if you show post the script here and link it, because this i'm sure that the script I made doesn't work, and it would clear things up for better scripters than me.

1 comment

0

oh yeah make sure to put wait(.1) before the last end so it doesnt run too fast.

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