Prevent error from destroying entire game

I am very mad right now because there has been this ongoing bug in my game that has just caused everyone to not be able to play and my game just went from 200 - 15 players because of it.

GetCharacterAppearenceAsync() has a chance of not working, which would normally be fine. But in this case, when it errors, it causes one of my scripts to completely lock up!

Here’s my code

for _,PlayerInfo in pairs(Players) do

	local CharacterAppearence = nil

	local Success, ErrorMessage = pcall(function()
		CharacterAppearence = game.Players:GetCharacterAppearanceAsync(PlayerInfo["key"].UserId)
	end)

	if Success then
		-- code
	end
end

For some reason, when this error happens, EVEN THOUGH IT’S WRAPPED IN A PCALL, the entire script seizes to work. Does anyone know what’s going on here?

So if the appearance is essential then it will stop the rest of the script from functioning along with any that require the appearance, you also arent retrying the pcall if it fails, if it is an absoloute for your game then do a while nil loop on appearance to retry until it works.

local CharacterAppearence = nil
while CharacterAppearance == nil do
    local Success, ErrorMessage = pcall(function()
	   CharacterAppearence = 
   game.Players:GetCharacterAppearanceAsync(PlayerInfo["key"].UserId)
   end)

   if Success then
	-- code
   end
   wait(3)
end
1 Like

It’s not required. If the character appearance doesn’t work, then it just won’t load the appearance.

then why give the appearance script if its unrelated, the issue must be something else, add prints at core points of your script to check script progress and see where it goes wrong

Because every time I look at my error and bug reports I get the http error followed by a a tsunami of people saying they can’t play.

now we are getting somewhere, do you use http service and it should tell you the line in which the error occurs

  1. Players:GetCharacterAppearanceAsync() failed because HTTP 500 (Internal Server Error) | ServerScriptService.GameHandler, line 230 - function PlacePlayersOnStage ServerScriptService.GameHandler, line 600 | GameHandler

Roblox is having outages at the moment, several of the APIs aren’t working. This issue is probably related to the following. Roblox Status

This is a problem with roblox, I am also experiencing many internal server errors, it should start working when roblox fixes whatever is going on.

yea the error tells you, easy mistake lol

1 Like

Ok. I’m just going to initiate server restart when this happens, as it’s not that common.

1 Like

Very weird that it freezes up, maybe spawn() could work.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.