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

On-spawn animation problem?

Game.Players.PlayerAdded:connect(function(player)
	while not player.Character do wait() end
	local character=player.Character
	local animateScript=character.Animate
	animateScript.fall.FallAnim.AnimationId='http://www.roblox.com/asset/?id='
	animateScript.walk.WalkAnim.AnimationId='http://www.roblox.com/asset/?id='
end)

whenever i die, the animation script doesn't work anymore. i know there are missing id's i just don't want to put them. i don't see why it wouldn't

1 answer

✓ Accepted answer

Well, you never set up a CharacterAdded event on the player. Also, be sure that you load the animation! So:

game.Players.PlayerAdded:connect(function(player)
	player.CharacterAdded:connect(function(character)
		local animateScript=character.Animate
		animateScript.fall.FallAnim.AnimationId='http://www.roblox.com/asset/?id='
		animateScript.walk.WalkAnim.AnimationId='http://www.roblox.com/asset/?id='
	end)
end)

1 comment

0

Thank you very much!

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