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

GUI to change player walking animation?

Asked by
par1d 19
5 years ago

I have a script that changes the walking animation of a player when they join the game however I would like it so when a player clicks a gui it changes the walking animation rather than the player already spawning in with the custom animation. How would I do this?

Here is the current script I have:

game.Players.PlayerAdded:connect(function(player)
while not player.Character do wait() end
local character = player.Character
local animateScript = character.Animate
animateScript.run.RunAnim.AnimationId = 'http://www.roblox.com/asset/?id=3714190073'
end

1 answer

Log in to vote
1
Answered by 5 years ago
Edited 5 years ago
GUIButton.MouseButton1Click:Connect(function()
    animationTrack:Play()
end)

GUIButton is a textbutton or a imagebutton, you should already have the animationTrack defined

0
noice develop_d 53 — 5y
Ad

Answer this question