my script wont run despite no errors does anyone know whats wrong
while true do
if script.Parent.Health.Value <= 100 and script.Parent.Health.Value >= 0 then
print("regening")
script.Parent.Health.Value = script.Parent.Health.Value + 1
wait(0.5)
end
print("did regen?")
wait()
end
There doesn’t seem to be anything wrong with your code; however I do notice that the health Value (when not regenerating) will be at 101 and the value will regenerate even when it’s 0 (though, as you implied, that might be intended since you’re making your own custom-type health system).
When you clone the script from another script, are you changing the script.Disabled property? The template script should be disabled, but when you clone it to the player, it should be enabled.
yes but i think i had this problem before and some guy told me its because you cant say one value is equal and less than this number and greater and equal to this other number because that would not make sense
I don’t know the context in which your previous problem occurred, but I can tell you that the conditional you wrote in this scenario makes 100% sense. The code in the if statement fires when the value is between 0 and 100 (inclusive). I see nothing wrong with that.
well i this point i remade the script to be something simpler and guranteed to work but it still refuses to work for some reason, which could lead me to think, do scripts even work in the player instance?
That’s different. You were checking to see if the ClockTime was less than a low number but ALSO greater than a higher number, which makes no sense. Here you’re checking to see if the value is lower than a HIGH number and greater than a LOW number, which does make sense.
Can I see the script that clones this script into the player along with the explorer window?