Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local par = script.Parent -- parent
- local player = game.Players.LocalPlayer -- local player
- local animations = par.Animations -- animation folder
- local function anim1() -- function
- local char = player.Character -- players character
- local animator = char.Humanoid.Animator -- animator inside the players character
- local animation = animations.A1 -- animation track
- animator:LoadAnimation(animation):Play() -- load and play the animation
- end
- local function anim2()
- local char = player.Character
- local animator = char.Humanoid.Animator
- local animation = animations.A2
- animator:LoadAnimation(animation):Play()
- end
- local function anim3()
- local char = player.Character
- local animator = char.Humanoid.Animator
- local animation = animations.A3
- animator:LoadAnimation(animation):Play()
- end
- par.Animation1.MouseButton1Click:Connect(anim1) -- connect the function ( play the animation
- par.Animation2.MouseButton1Click:Connect(anim2)
- par.Animation3.MouseButton1Click:Connect(anim3)
Advertisement
Add Comment
Please, Sign In to add comment