I want to make a kill brick that decreases the players heath slowly. I try to script the killing but the first part of heath screws up, when I tested it my heath went back and forward between 90 and 80.
I want the heath to decrease not going back and forward, why is it doing this?
my script: function onTouched(part) local h = part.Parent:findFirstChild("Humanoid") if h~=nil then h.Health = 90 wait(5) h.Health = 80 wait(5) h.health = 70 wait(5) h.health = 60 wait(5) h.health = 30 wait(5) h.health = 15 wait(5) h.health = 7 wait(5) h.health = 0 end end script.Parent.Touched:connect(onTouched)
I don't know why its not working correctly
Please help me scriptinghelpers!

1 comment
Please put your code inside of the two lines of squiggles (which should each be on their own line) created when click the Lua symbol on your text editor. It formats the code to make it easier to read.