I have a gui button to do an animation, in studio it works ,but in the game it doesnt work. Could anyone help me create a script that plays a animaion when the gui is pressed? All help much appreciated!
Don't really feel like writing the whole script but since you have to play animations on the server then you'll need a RemoteEvent in the ReplicatedStorage or wherever. Then do something like this:
local script
local gui = script.Parent local event = game.ReplicatedStorage.event gui.MouseButton1Down:Connect(function() event:FireServer() end)
script
local char = script.Parent local event = game.ReplicatedStorage.event local AnimationTrack --set to location of your animation track local Animation = char.Humanoid:LoadAnimation(AnimationTrack) event.OnServerEvent:Connect(function(player) if player.Name == char.Name then Animation:Play() end end)