Hey I Made an Emote gui and it has buttons like "wave" and "dace4".But when I press it nothing happens. How do I make an animation play when I click the button?
COMMUNITY QUESTION
How do i make animation function when i Click a button?
1 answer
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:wait()
local humanoid = Character:WaitForChild("Humanoid")
local anim = Instance.new("Animation", humanoid)
anim.AnimationId = "http://www.roblox.com/asset/?id=01468567293" --Your animation id
script.Parent.MouseButton1Click:Connect(function(key)
local animTrack = humanoid:LoadAnimation(anim)
animTrack:Play()
end)
I hadn't tested but it should work, make in inside of a text button and use local script.
1 comment
0
thx
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
http://wiki.roblox.com/index.php?title=API:Class/GuiButton/MouseButton1Click and http://wiki.roblox.com/index.php?title=API:Class/Humanoid/LoadAnimation