so im making this thing and i used hum.Running:Connect(function() but i noticed that it only fires if the speed changes im making a walking animation when the player is holding a gun i need it to sway and i need it so if the speed changes to 0 it stops i want it to all happen in the same loop is there any easy way of getting the speed?
EDIT: ok i did it this is what i did:
local speed = 0
hum.Running:Connect(function(speedyboi)
speed = speedyboi
end
while wait() do
--wat ever u want speed = the players speed
end

1 comment
You can compare the Velocity of the player's HumanoidRootPart in a loop to determine if they're walking or not