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

Im not sure where to place an animation script?

Hi there, currently there is a dummy in the workspace which I am trying to get to animate when a user presses a button inside the starterGui. However, its working in roblox studio but not inside the actual game. I've got no idea what to do. I assumed it had something to do with where I placed the script (which is inside the starter gui) and I attempted to put the script into workspace but I didn't know how to trigger the script from the starter gui. Can anyone help me please?

script.Parent.MouseButton1Click:connect(function()
	for i,v in pairs(game.Workspace:GetChildren()) do
		if v.Name == "Dummy" then
			local x = v.Humanoid:LoadAnimation(v.Animation)
			x:Play()
		end
	end
end)

Sorry if this was a stupid question :l

2 comments

0

Is this a normal Server Script or a LocalScript?

0

Ah wait, since it is in StarterGui, you're gonna need RemoteEvents because only a Server Script can make animations visible for all the players.

1 answer

Put it into a TextButon or ImageButton

The "MouseButton1Click" can only be used in one of those.

So yeah.

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