freiza567
|
  |
| Joined: 07 Aug 2010 |
| Total Posts: 103 |
|
|
| 22 Jun 2014 04:42 PM |
trying to make a bed that heals you slowly, when u go on the bed it heals you like i wanted it to but when u jump off the bed ur still getting heal i want the healing to stop when u jump off the bed and the bed is a seat that heals you
heres the script code
function onTouched(part) while true do wait(0.3)
local h = part.Parent:findFirstChild("Humanoid") if (h ~=nil) then h.Health = h.Health + 0.1 end end end
script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
freiza567
|
  |
| Joined: 07 Aug 2010 |
| Total Posts: 103 |
|
| |
|
|
| 22 Jun 2014 05:58 PM |
.Touched .TouchedEnded
~I'm an Angry Llama~ |
|
|
| Report Abuse |
|
|
freiza567
|
  |
| Joined: 07 Aug 2010 |
| Total Posts: 103 |
|
|
| 22 Jun 2014 06:09 PM |
| you never siad where to put it in the script it dosent help |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2014 06:12 PM |
local heal = false function onTouched(part) heal = true while heal do wait(0.3) local h = part.Parent:findFirstChild("Humanoid") if (h ~=nil) then h.Health = h.Health + 0.1 end end end function TouchStop() healing = false end script.Parent.Touched:connect(onTouched) script.Parent.TouchedEnded:connect(TouchStop) |
|
|
| Report Abuse |
|
|
freiza567
|
  |
| Joined: 07 Aug 2010 |
| Total Posts: 103 |
|
|
| 22 Jun 2014 06:17 PM |
| it still dosnt work it still heals you when ur off the Seat that heals you |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2014 06:20 PM |
function onTouched(part) while true do wait(0.3) local h = part.Parent:FindFirstChild("Humanoid") if (h ~=nil) then h.Health = h.Health + 0.1 else if h.Jump then h.Health = h.Health + 0 end end end end
script.Parent.Touched:connect(onTouched)
idk |
|
|
| Report Abuse |
|
|
freiza567
|
  |
| Joined: 07 Aug 2010 |
| Total Posts: 103 |
|
| |
|
|
| 22 Jun 2014 06:29 PM |
| Then make youre own script |
|
|
| Report Abuse |
|
|
freiza567
|
  |
| Joined: 07 Aug 2010 |
| Total Posts: 103 |
|
|
| 22 Jun 2014 06:34 PM |
| and this keeps happening i did evrething i could so i came here |
|
|
| Report Abuse |
|
|
| |
|
freiza567
|
  |
| Joined: 07 Aug 2010 |
| Total Posts: 103 |
|
|
| 22 Jun 2014 06:42 PM |
| no matter whay i do it still heals you when your off of the seat |
|
|
| Report Abuse |
|
|
freiza567
|
  |
| Joined: 07 Aug 2010 |
| Total Posts: 103 |
|
|
| 22 Jun 2014 06:43 PM |
| also ignore my grammar keyboard is mest up |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2014 06:46 PM |
LOL NUBZ!
local heal = false function onTouched(part) heal = true while heal do wait(0.3) local h = part.Parent:findFirstChild("Humanoid") if (h ~=nil) then h.Health = h.Health + 0.1 end end end function TouchStop() heal = false -- IT SAID HEALING LAMFOWMFLAWDAOWNDAEW HAHAHA XD k bye end script.Parent.Touched:connect(onTouched) script.Parent.TouchedEnded:connect(TouchStop) |
|
|
| Report Abuse |
|
|
freiza567
|
  |
| Joined: 07 Aug 2010 |
| Total Posts: 103 |
|
|
| 22 Jun 2014 06:53 PM |
| still keeps healing when your off the bed seat |
|
|
| Report Abuse |
|
|
| |
|
freiza567
|
  |
| Joined: 07 Aug 2010 |
| Total Posts: 103 |
|
|
| 22 Jun 2014 07:09 PM |
ive been trying to fix it for more then 2 months and now it lookes like even most scripters cant even fix this now |
|
|
| Report Abuse |
|
|
Zerio920
|
  |
| Joined: 06 Apr 2012 |
| Total Posts: 3311 |
|
|
| 22 Jun 2014 07:12 PM |
| Did you try debouncing it? |
|
|
| Report Abuse |
|
|
freiza567
|
  |
| Joined: 07 Aug 2010 |
| Total Posts: 103 |
|
|
| 22 Jun 2014 07:15 PM |
| i did in 2 different ways it wasnt even working anymore when i did |
|
|
| Report Abuse |
|
|
Stefan631
|
  |
| Joined: 23 Dec 2010 |
| Total Posts: 1350 |
|
|
| 22 Jun 2014 07:18 PM |
| Hmmm. When you sit, isn't there a SeatWeld? ;) |
|
|
| Report Abuse |
|
|
Zerio920
|
  |
| Joined: 06 Apr 2012 |
| Total Posts: 3311 |
|
|
| 22 Jun 2014 07:22 PM |
| it's cause you're putting the debounces in the wrong spots. When you do that, it doesn't work. |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2014 07:24 PM |
script.Parent.Touched:connect(function(part) local h = part.Parent:findFirstChild("Humanoid") if (h ~=nil) then local D = Instance.new("BoolValue", h) D.Name = "Healing" while D do wait(.3) h.Health = h.Health + 0.1 end end end)
script.Parent.TouchEnded:connect(function(part) local D = part.Parent:FindFirstChild("Humanoid"):FindFirstChild("Healing") if D then D:Destroy() end end)
--Have fun. |
|
|
| Report Abuse |
|
|
freiza567
|
  |
| Joined: 07 Aug 2010 |
| Total Posts: 103 |
|
|
| 22 Jun 2014 07:34 PM |
| and it still keeps healing when you jump off the seat |
|
|
| Report Abuse |
|
|
Zerio920
|
  |
| Joined: 06 Apr 2012 |
| Total Posts: 3311 |
|
|
| 22 Jun 2014 07:36 PM |
| Dont robloxians heal automatically? |
|
|
| Report Abuse |
|
|
freiza567
|
  |
| Joined: 07 Aug 2010 |
| Total Posts: 103 |
|
|
| 22 Jun 2014 07:38 PM |
yes but i added a script in my game to stop the human regen now if pepole dont notice its not a brick i have to go on its a seat |
|
|
| Report Abuse |
|
|