Maybe add another if statement like:
if ScriptIsDestroyed == true then break end;
Right before the script is destroyed:
ScriptIsDestroyed = true;
Maybe add another if statement like:
if ScriptIsDestroyed == true then break end;
Right before the script is destroyed:
ScriptIsDestroyed = true;
I’ll try something like that real quick and see if that works
My solution should be considered a short-fix until you figure out what else is causing it.
Try adding it to Debris?I know this probably doesnt help,but it doesnt cost try!
Also, never used or heard of coroutines, i’ll do some research on that
Yeah as @Chaddaking said, you could have some boolean value and implement your while loop that way
while (ScriptIsDestroyed) do
wait(rate.Value)
--do the rest of the stuff
end
I’ve just added a bool value called “IsDestroyed” into each creature’s grow script. And when the creature grows it changes the value to true and breaks the loop if the value is true. This worked, but like Chaddaking said this should be a temporary fix until I figure out what was causing this.
Nah it’s not rly one of those fast fixes until you figure out what was causing it, everything’s fine if you’re using it.
Anyways, thanks for the help everyone!