Setting character disconnects client

CharacterAutoLoads is false and this is in ServerScriptService:

game.Players.PlayerAdded:connect(function(player)
	for i=10,1,-1 do print(i)wait(1)end
	local model=Instance.new("Model")wait()print("A")wait()
	player.Character=model wait()print("B")wait()
end)

I open the dev console before it counts down and then it prints A. It does not print B. I get disconnected.

test place: bug test - Roblox

edit: also only happens online.

game.Players.PlayerAdded:connect(function(player)
	player.CharacterAdded:wait():Destroy()
end)

tells me the game has shut down when I join online.

and if I try to delete the default character and set my own then it just spawns a new one because it isn’t alive. so I can’t replace the default character because it just respawns and I also can’t turn off CharacterAutoLoads because it disconnects you. how am I supposed to set my own characters?

I remove all limbs, set the HipHeight, then weld my custom character to the HRT.

Looks like this is your problem. StreamingEnabled while making the character not have a part named “Torso” results in a crash.

StreamingEnabled was causing another issue with the client thinking its character’s head doesn’t exist so I turned it back off. Good to know that also solves this, now I can get rid of my hacky character references.