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

why wont this animation play when gui is clicked? (unsolved)

so i want it to play an animation when i click a gui. im getting no errors but its not playing.

player= game.Players.LocalPlayer 

animation = script:WaitForChild("Animation")

enabled = true 

game.StarterGui.BodyRoll.BodyRollText.MouseButton1Click:connect(function()
	
	if enabled then 
		enabled = false

animationtrack = player.Character.Humanoid:LoadAnimation(animation)
animationtrack:Play() 

wait(1)		
	end
	end)



1 comment

0

so wait do TextButtons not have any click function?

1 answer

I think you made a typo.

player = game.Players.LocalPlayer 

animation = script:WaitForChild("Animation")

enabled = true 

game.StarterGui.BodyRoll.BodyRollText.MouseButton1Click:connect(function()

    if enabled then 
        enabled = false

animationtrack = player.Character.Humanoid:LoadAnimation(animation)
animationtrack:Play() 

wait(1)     
    end
    end)


2 comments

0

this does not fix the problem :s

0

Oops, I MADE A TYPO! Let me try and fix that, then try it.

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