Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local animation = Instance.new("Animation")
- animation.AnimationId = "http://www.roblox.com/Asset?ID=3058460854"
- local trackanimation = nil
- local playability = true
- function playAnimation(AnimationSource)
- if playability == true then
- local plr = game.Players.LocalPlayer
- trackanimation = plr.Character.Humanoid:LoadAnimation(animation)
- trackanimation.KeyframeReached:connect(function(kf)
- print('Working')
- end)
- trackanimation:Play()
- end
- end
- script.Parent.MouseButton1Click:connect(playAnimation)
- --INSTRUCTIONS--
- --1. In the "Explorer" tab on Roblox Studio, Insert "ScreenGui" in the "StarterGui" Folder
- --2. Insert "TextButton" on "ScreenGui"
- --3. Add "LocalScript" on "TextButton", and Clear Everything on the "LocalScript" and Copy & paste this into the "LocalScript"
- --4. Test it and Click the Gui Button on-screen!
- --5. Enjoy! :D
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement