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

How would you do a idle animation, if you have a weapon out?

Asked by
Mystdar 352 Moderation Voter
10 years ago

I know how you play an animation:

local animation = Instance.new("Animation")
2   animation.AnimationId = "http://www.roblox.com/Asset?ID=144884906" -- ID here
3    
4   local animTrack = Humanoid:LoadAnimation(animation)
5   animTrack:Play()

But how would I do it if this animation occured when your character isn't moving and will continue to occur providing they are not moving, (Maybe a:)

while true do 

Or something like that.

1 answer

Log in to vote
1
Answered by 10 years ago
moving=false
Humanoid.Running:connect(function(value)
if value>0 then
moving=true
else 
moving=false
end)

while wait() do
if not moving then
--play your animation
end
end
0
Where would I put this script? Mystdar 352 — 10y
Ad

Answer this question