I keep on getting a Script Timeout Error

Hello, I am keep on getting an error that says something like “Script Timeout, Exhausted”. This happened after I wrote a script to rotate a model using Pivots. This error makes the game freeze for few seconds. Is there a way to remove this error? Thank you.

Can you show da script? (character limit)

1 Like

Do you have an infinite loop that doesnt have a wait()?

2 Likes

I don’t think it’s because of the script, the error says the while true do loop is causing the script timeout.

I have a while true do loop.

Instead of while true do make it while true and wait() do

1 Like

Add some sort of wait() or yielding statement in your while loop somewhere so that it won’t cause that error.

1 Like

Thank you, I didn’t think about while true do and wait().

1 Like

I meant while wait() lol, it really doesnt matter though, it would be a minimal performance impact anyways. EDIT: it wouldn’t matter either to use task.wait() because there doesnt need to be any precision whatsoever the loop just needs to yield.

I never talked about performance

EDIT: also sorry I didn’t know you meant while wait(), my bad

Then what is the problem? lolll

there wasn’t a problem with the code, I just didn’t see why a true was needed, but since you meant “while wait() do” I decided to delete my reply from before to remove spam

EDIT:

I only said that because wait() is pretty much deprecated now, so I wanted to encourage use of it

1 Like