i am trying to make a brick that when clicked will slowly drain your health. the code goes as follows:
script.Parent.MouseClick:Connect(function(plr)
local h = plr.Character.Humanoid
for i = 100, 0, 1 do
h.Health = i
end
end)
it should work fine from what i understand, but whenever i click on the brick nothing happens. I'm pretty sure that it doesnt have anything to do with the variables because whenever i type:
script.Parent.MouseClick:Connect(function(plr)
local h = plr.Character.Humanoid
h.Health = 0
end)
it works, so the variables arent the problem.
Help would be appreciated

2 comments
Instead of "for i = 100, 0, 1", do like this "for i = 100, 0, -1"
thanks lol im an idiot