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

Animation not loading after respawn?

Animation plays at first but when I reset/respawn it doesn't load the animation.. Any help would be appreciated.

local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
local Animator = Humanoid:WaitForChild("Animator")
local emote = Animator:LoadAnimation(script.Parent.Emote1)

Player.CharacterAdded:Connect(function(Char)
	Character = Char
	Humanoid = Char:WaitForChild("Humanoid")
	HumanoidRootPart = Char:WaitForChild("HumanoidRootPart")
end)

playing = false

script.Parent.MouseButton1Click:Connect(function()
	if playing == false then
		emote:Play()
		Humanoid.WalkSpeed = 0
		Humanoid.JumpPower = 0

1 answer

Pop this in StarterCharacterScripts and it should reset every time the character respawns.

1 comment

0

I forgot to say it's inside of a gui, I just wanted to make a if you click the button inside the gui it plays.

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