CharacterAppearanceLoaded ain't always firing after character's loaded

player.CharacterAdded:Connect(function(character)
		character.Humanoid.Died:Connect(function()
			
			wait(configuration.RESPAWN_TIME)
			player:LoadCharacter()
			print('Died', player.Name)
			player.CharacterAppearanceLoaded:Connect(function()
				print('Loaded', player.Name)
				if not configuration.GAME_RUNNING then return end
				print('Load complete', player.Name)
				classesManager:GiveClass(player)
			end)
		end)
	end)

Output prints ‘Died’ with the players name whenever they die, but sometimes after a player has respawned, it won’t print ‘Loaded’ (after the CharacterAppearanceLoaded function)

I’d say around 9/10 this function never fires. This occurs in both Studio, as well as online servers. What is causing this? And can it be told to wait for the characters appearance to load?

print('Died', player.Name)
player.CharacterAppearanceLoaded:Wait()
print('Loaded', player.Name)

Tried this, still same result, not printing the second print.

EDIT Upon further testing, it seems to fire when you die a second time (but it fires before your character has actually loaded.

Order of Events:

Reset Character
Output:
[Died NinjoOnline]

Reset Character again
Output:
[Loaded NinjoOnline]
[Died NinjoOnline]

2 Likes
game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(char)
		char.Humanoid.Died:Connect(function()
			player:LoadCharacter()
			print("died", player.Name)
		end)
	end)
	player.CharacterAppearanceLoaded:Connect(function()
		print("loaded", player.Name)
	end)
end)

I’ve tried this, and it seems to work. Tho, I don’t know why yours isn’t working.

Your code it setup wrong.
You have AppearanceLoaded event inside Died event, meaning you first have to die for AppearanceLoaded event to get connected. That’s why it works after dying once.

You should setup your code so that AppearanceLoaded is outside Died event.

2 Likes

CharacterAppearanceLoaded needs to be inside the top-level scope (underneath PlayerAdded). This code tells your function to connect every time a Humanoid triggers the death state. The water is there before the barrel.

1 Like
player.CharacterAppearanceLoaded:Connect(function()
	print('Appearnce')
	if not configuration.GAME_RUNNING then return end
	print('Loaded')
	classesManager:GiveClass(player)
end)

player.CharacterAdded:Connect(function(character)
	character.Humanoid.Died:Connect(function()
		
		wait(configuration.RESPAWN_TIME)
		player:LoadCharacter()

	--	player.CharacterAppearanceLoaded:Connect(function()
			--if not configuration.GAME_RUNNING then return end

			--classesManager:GiveClass(player)
		--end)
	end)
end)

Never prints anything that is inside the CharacterAppearanceLoaded function. Even after multiple resets

EDIT Works in play solo but not in server testing (could this be because server tests use characters without clothing/packages/etc??

1 Like


Yes, this must be the issue. Try it in an actual game server, not in studio

1 Like

Gonna have to bump this, as it still doesn’t work.

print(1)
player.CharacterAppearanceLoaded:Wait()
print(2)

Prints 1, never prints 2. Happens in both studio as well as online testing.

2 Likes

Where is the script located? What is its parent.

It’s a LocalScript located somewhere inside the StarterGui

try placing it in starterplayerscripts

Try to maintain singular posts. You already have a running thread that was answered by staff: