How to load custom character

There is a player:LoadCharacter() function, which loads either players avatar, or starter character in starterplayer, but i want to load a certain character for a certain player, for instance, according to its Team

Is it possible?

Your going to have to use a playeradded event and then a trick you could use is checking all the stuff you need to check and then once those checks are verified put the StarterCharacter into StarterPlayer, what this will do is make the current iteration of the playeradded event which is the player you wanted to be loaded as the starterchartacter, and then once the character is loaded quickly remove the startercharacter from StarterPlayers, this is so that the character that just joined after all that doesnt get loaded in as startercharacter we just put into startercharacter

2 Likes

would work cuz its a pvp thing were everyone dies very quickly(

1 Like

Yeah your fine it only will run when a player is added not when a character is added, well your script to check if the player is the player your looking for

1 Like

but i have autocharacterload false so i need to manually set parent of startercharacter upon each respawn?

You could possibly take advantage of Humanoid:ApplyDescription(). This changes the humanoid’s appearance based off a HumanoidDescription.

1 Like
game.Players.PlayerAdded:Connect(function(player)
	player:LoadCharacter()
	wait()
	if player.UserId == YourUserIdHere then -- If you're not trying to target a specific user, simply remove this if statement.
		local character = game.ServerStorage.Barb:Clone()
		character.Name = player.Name
		
		player.Character = character
		character.Parent = workspace
	end
end)

If this doesn’t work, try using a wait() in the LoadCharacter function to solve the problem.

6 Likes

This does work, but is doesnt work as startercharacter would, i mean it wouldnt put animate script etc

Fixed absence of scripts by simply copying children of startercharscripts, thank you!

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