Advertisement
Guest User

Untitled

a guest
Jul 24th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. Local Script
  2.  
  3. --//Coded By XXBestShad0w
  4.  
  5. local Pills = script.Parent
  6. local Handle = Pills:WaitForChild("Handle")
  7.  
  8. local Player = game.Players.LocalPlayer
  9. local Character = workspace:WaitForChild(Player.Name)
  10. local Humanoid = Character:WaitForChild("Humanoid")
  11. local Mouse = Player:GetMouse()
  12.  
  13. local CanUse = true
  14. local Equipped = false
  15.  
  16. local PillsAnim = script:WaitForChild("PillsAnim")
  17.  
  18. local function LoadAnimation(Who,track)
  19. x = Who:LoadAnimation(track)
  20. end
  21.  
  22. local function PlayAnimation(track)
  23. track:play()
  24. end
  25.  
  26. local Mouse_Icon = "rbxasset://textures/GunCursor.png"
  27. local Reloading_Icon = "rbxasset://textures\\GunWaitCursor.png"
  28.  
  29. Pills.Equipped:connect(function()
  30. Equipped = true
  31. Mouse.Icon = Mouse_Icon
  32. Mouse.Button1Down:connect(function()
  33. if Humanoid and Humanoid.Health < Humanoid.MaxHealth and Equipped and CanUse then
  34. CanUse = false
  35. if Humanoid then
  36. LoadAnimation(Humanoid,PillsAnim)
  37. wait(.1)
  38. PlayAnimation(x)
  39. end
  40. local Clone = script:WaitForChild("Pills_Server"):Clone()
  41. Clone.Parent = Character
  42. Clone.Disabled = false
  43. wait(1)
  44. CanUse = true
  45. Pills:Destroy()
  46. end
  47. end)
  48. end)
  49.  
  50. Pills.Unequipped:connect(function()
  51. Mouse.Icon = ""
  52. Equipped = false
  53. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement