Help with respawning

Why won’t the player respawn?

game.Players.CharacterAutoLoads = false

game.Players.PlayerAdded:Connect(function(player)
	local avs = game:FindService("ReplicatedStorage").ColorsAvs.Default:GetChildren()
    local int = math.random(#avs)
    local randav = avs[int]

	if player.Name == "ollieryz" then
		player:LoadCharacterWithHumanoidDescription(game.ReplicatedStorage.ColorsAvs.VIPAv)
	else
    	player:LoadCharacterWithHumanoidDescription(randav)
	end
	
	player.CharacterAdded:Connect(function(char)
		char.Humanoid.Died:Connect(function()
			wait(3)
			player:LoadCharacter()
		end)
	end)
end)

When is the player not spawning, when they join the game, or when they die?

Should game.ReplicatedStorage.ColorsAvs.VIPAv be game.ReplicatedStorage.ColorsAvs.VIPAv.Value, or is it a RemoteEvent/Function/BindableEvent, in that case you’ll need to require it.
Anything in the developer console [F9]?

[primaraly if the VIPAv is a value holder [color3value, or the like] add .Value to the end or else you will not be requiring it. I am unsure if you can push that to a Humanoid description, I am going to attempt your code, be back soon.

Uhh, no, it’s a HumaoidDescription, the player isn’t loading when they die.

Okay, can you please send your Explorer, and show me how your folders/things are laid out. It appears that you are sending “LoadCharacterWithHumanoidDescription” null, perhaps because it does not support the datatype you are trying to send.

isn’t null, it’s dying thats the issue

Wow, I am stupid. I figured out the issue.
Move your “player.CharacterAdded:Connect(function(char)” to before the if statement, you are registering your event listener AFTER the player has loaded.

Now my character won’t load at all

Put this before the if statement

spawn(function()
player.CharacterAdded:Connect(function(char)
char.Humanoid.Died:Connect(function()
wait(3)
player:LoadCharacter()
end)
end)
end)

nevermind, fixed it!

Yay, happy you fixed it. What was wrong?

Thanks.

Put it in the wrong place. :eyes:

that’ll do it. happy I could help!
Have a good day.