Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
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.