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

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

Asked by 5 years ago
Edited 5 years ago

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

0
just add a loop to it, then stop it when the character moves Clasterboy 72 — 5y
0
HUH biggun428 8 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

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.

0
oh yeah make sure to put wait(.1) before the last end so it doesnt run too fast. fighterkirbyzx 102 — 5y
Ad

Answer this question