I have this script that drains health when a player's "Grabbed" value is set to true, and to stop draining health when the value is false.
The problem is, after the value turns false, if it is currently waiting to hurt the character again, it will still hurt the character after the grabbed value is false. Is there any way to stop this?
char.charactervalues.Grabbed.Changed:Connect(function()
if char.charactervalues.Grabbed.Value == true then
while true do
if char.charactervalues.Grabbed.Value == false then
break;
end
wait(1)
char.Humanoid.Health -= 13
end
end
end)

1 comment
This does not fix the problem, it still damages me after the grabbed value is false.