Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Im not sure where to place an animation script?

Asked by 7 years ago

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

0
Is this a normal Server Script or a LocalScript? Mayk728 855 — 7y
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. Mayk728 855 — 7y

1 answer

Log in to vote
0
Answered by
Wiscript 622 Moderation Voter
7 years ago

Put it into a TextButon or ImageButton

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

So yeah.

Ad

Answer this question