When I touched the oart that is located in script.Parent, it takes away all health. I want it to take away half.
Text = "You have gotten health taken away." function Touched(hit) --"Touched" is name of the function. local hum = hit.Parent:findFirstChild("Humanoid") if hum then hum.Health = hum.Health - (hum.Health/2) --subtracts half the health, this won't ever kill the player though print(Text) end end script.Parent.Touched:connect(Touched)
Why don't you do this:
Text = "You have gotten health taken away." ting = 0 function Touched(hit) local hum = hit.Parent:findFirstChild("Humanoid") if hum then if ting == 0 then ting = 1 hum.Health = hum.Health -50 --subtracts 50 health from him print(Text) wait(1) ting = 0 end end end script.Parent.Touched:connect(Touched)