Guest User

AnimPlay

a guest
Dec 19th, 2016
5,113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.50 KB | None | 0 0
  1. -- Import animation
  2. local animation = Instance.new("Animation")
  3. animation.AnimationId = "http://www.roblox.com/Asset?ID=580342958"
  4. -- Local variables
  5. local animTrack = nil
  6. local canPlay = true
  7.  
  8. function playShockAnim(Source)
  9.     if canPlay then
  10.         local player = script.Parent.Parent
  11.         canPlay = false
  12.         animTrack = player.Humanoid:LoadAnimation(animation) -- Load animation into Humanoid
  13.         canPlay = true
  14.         animTrack:Play() -- Start the animation
  15.     end
  16. end
  17.  
  18. playShockAnim(script.Parent.Parent)
Add Comment
Please, Sign In to add comment