Advertisement
beddie22

beddie22's Medkit

May 22nd, 2016
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. -- Made by beddie22 and EthanHong0407 mostly beddie though but thats ok, this does not require name
  2. local Medkit = script.Parent
  3. local function handleTouch(otherpart)
  4. local humanoid = character:FindFirstChild('Humanoid')
  5. if humanoid then
  6. print('beddie22s Medkit') -- PLEASE DO NOT CHANGE
  7. end
  8. end
  9. -- I KNOW IM NOT GOOD AT SCRIPTING
  10. Medkit.touched:connect(handletouch)
  11.  
  12. local Medkit = script.Parent
  13. local healAmount = 100 -- Health you want your Medkit to heal
  14. local function handleTouch(otherpart)
  15. local character = otherPart.Parent
  16. local humanoid = character:FindFirstChild('Humanoid')
  17. if humanoid then
  18. local currenthealth = humanoid.Health
  19. local newhealth = currenthealth + 100 -- Also put the health down here
  20. humanoid.Health = newHealth
  21.  
  22. end
  23.  
  24. Medkit.Touched:connect(handleTouch)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement