|
| 28 Jun 2014 01:29 PM |
so i am trying to make a regen script that regenerates +5 health while youre touching a part called mat this is my script so far that has crashed LOL -------------------------------------------- while true do deb=false script.Parent.Touched:connect(function(hit) if not deb then deb=true human=hit.Parent:findFirstChild("Humanoid") if human then human.Health=human.Health+5 end wait(2)--denounce time deb=false end end) end
|
|
|
| Report Abuse |
|
|
|
| 28 Jun 2014 01:48 PM |
| please help i dont have much time left |
|
|
| Report Abuse |
|
|
|
| 28 Jun 2014 02:02 PM |
debounce = false
script.Parent.Touched:connect(function(hit) if not debounce then debounce = true local human = hit.Parent:FindFirstChild("Humanoid") if human then human.Health = human.Health+5 wait(2) debounce = false end end end) |
|
|
| Report Abuse |
|
|
|
| 28 Jun 2014 02:02 PM |
Healing = false DB = false
script.Parent.Touched:connect(function(h) local Hum = h.Parent:FindFirstChild("Humanoid") if Healing == false and DB == false and Hum then Healing, DB = true, true wait(2) --Debounce, make sure they stand here at least 2 seconds DB = false while Healing == true do Hum.Health = Hum.Health + 5 end end end)
script.Parent.TouchEnded:connect(function(h) local Hum = h.Parent:FindFirstChild("Humanoid") if Hum then Healing = false end end)
--It can only heal one person at a time :D Just an added bonus XD |
|
|
| Report Abuse |
|
|
|
| 28 Jun 2014 02:03 PM |
Healing = false DB = false
script.Parent.Touched:connect(function(h) local Hum = h.Parent:FindFirstChild("Humanoid") if Healing == false and DB == false and Hum then Healing, DB = true, true while Healing == true do Hum.Health = Hum.Health + 5 end end end)
script.Parent.TouchEnded:connect(function(h) local Hum = h.Parent:FindFirstChild("Humanoid") if Healing and DB and Hum then Healing, DB = false,false end end)
--It can only heal one person at a time :D Just an added bonus XD |
|
|
| Report Abuse |
|
|