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

Can anyone help me with this animation script?

i made a jump animation script but when i did it worked but when you reset and or respawn it does not run anymore heres the script

Game.Players.PlayerAdded:connect(function(player)
while not player.Character do wait()end
local character=player.Character
local animateScript=character.Animate
animateScript.jump.JumpAnim.AnimationId="http://www.roblox.com/asset/?id=253057842"
end)

1 comment

0

I do not think I will be able to solve this one, it is very confusing.

1 answer

✓ Accepted answer

The reason it only works until you reset/respawn is because the AnimationId is not being changed when the character is added, so the animation does not work and the script will not run.

To fix this, you should use the CharacterAdded event to make sure the AnimationId of the animation is changed every time the player respawns.

Game.Players.PlayerAdded:connect(function(player)
	player.CharacterAdded:connect(function(character) --CharacterAdded event being added to the script.
		local animateScript=character:WaitForChild("Animate") --Waits until Animate is found in the character.
		animateScript.jump.JumpAnim.AnimationId="http://www.roblox.com/asset/?id=253057842"
	end)
end)

I hope my answer helped you. If it did, be sure to accept it.

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