Advertisement
HowToRoblox

LiftAnimationScript

Jan 13th, 2020
3,214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.62 KB | None | 0 0
  1. local plr = game.Players.LocalPlayer
  2.  
  3. local char = plr.Character or plr.CharacterAdded:Wait()
  4.  
  5.  
  6. local tool = script.Parent
  7.  
  8. local anim = script:WaitForChild("LiftAnimation")
  9.  
  10.  
  11. local isLifting = false
  12.  
  13.  
  14. local givePowerEvent = game.ReplicatedStorage:WaitForChild("OnClickGivePower")
  15.  
  16.  
  17. tool.Activated:Connect(function()
  18.        
  19.     if isLifting == true then return end
  20.        
  21.     if not char:FindFirstChild("Humanoid") then return end
  22.        
  23.     isLifting = true
  24.    
  25.    
  26.     local loadedAnim = char.Humanoid:LoadAnimation(anim)
  27.    
  28.     loadedAnim:Play()
  29.    
  30.    
  31.     givePowerEvent:FireServer()
  32.    
  33.    
  34.     wait(2)
  35.    
  36.    
  37.     isLifting = false
  38.    
  39. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement