How can I make sure my script continues to work even if I get an error?

My game calling GetFriendsOnline() on While loop.
But it often causes error (HTTP 429).
After error, the whole script stop working.

I want to keep it work.
Can you teach me what should i do?

use pcall.

-- example
pcall(function()
-- code here
end)
2 Likes

I’m new and I’m not good at using them but im pretty sure you are supposed to make a pcall function

yo thanks i forgot to use it! my bad

1 Like