Hey everyone! I made this block that is supposed to put the gravity number on it. It works, but when I change the gravity the checker does not update to the new number. Does anyone know why?
while true do
script.Parent.Text = "Gravity: "..game.Workspace.Gravity
end
Is this the entire script?
Since it has no wait() in it I’d expect it to lock up your game and not work at all.
Instead of a while true do loop why not make it a function that triggers when Gravity changes?
How is it not erroring? Surely it should’ve errored cause of no wait. How are you changign the gravity, from the client or the server, and what type of script is this and where is it located?
And as @Scottifly stated, it’s better to use GetPropertyChangedSignal on the gravity rather tahn an infinite loop
The while loop is probably shooting an exhaustion error. Use GetPropertyChangedSignal as @EmbatTheHybrid mentioned. Always refrain from using while true do loops (no waiting). It drops the game’s performance and they often shoot exhaustion errors. Hopefully this addresses your concerns.