local health = script.Parent.Parent.Health.Value
local debounce = false
function onHit()
if debounce == false then
debounce = true
health = health - 10
print (health)
wait(3)
debounce = false
script.Parent:Destroy()
end
end
script.Parent.Touched:connect(onHit)
I made this script so that it subtracts 10 from the NumberValue (500), changing it to 490. When the number value is printed through the script, the console says 490, as it should. But when I go into the workspace and look at the actual Value of the NumberValue it still says 500. Shouldn't that change too when the part gets hit?

4 comments
It's a normal script, and also FE isn't enabled which adds to my confusion
Okay figured it out, gimme a bit to reedit it.
Whoa, it works now. Thanks for the answer
No problem man, I had a major problem with that when I first learned. You get used to it though ; P