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

How do I make anims?

This script changes the default anim for example I go to my place and the idle anim is different so here is the script, yes it works.

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

And the problem is that when you reset, the anims are gone so can someone help me? Thanks.

1 answer

Use the CharacterAdded event in the player. It fires when the character is added or respawned.

Game.Players.PlayerAdded:connect(function(player)
	player.CharacterAdded:connect(function(char) --CharacterAdded event with an anonymous function. Char is the variable of the character.
		repeat wait() until char --Safety measure so that the character has time to properly load.
		local animateScript = char.Animate
		animateScript.idle.Animation1.AnimationId = 'http://www.roblox.com/asset/?id=80980242'
	end)
end)

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