How to set startercharacter for specific players, dynamically

local plr = game.Players.LocalPlayer
if plr.Name == "Polynovuh" or plr.Name == "Player1" then
	script.StarterCharacter.Parent = game.StarterPlayer
end

literally just a script with runcontext of local in replicatedfirst; doesnt work

1 Like

That doesnt work or make any sense

2 Likes

Why doesn’t it make any sense? Are there any errors in the output?

1 Like

That makes no sense because a script in startercharacterscripts will only clone after characteradded meaning the startercharacter will have already been assigned

Replicatedfirst will always fire first

1 Like

First put game.Players.CharacterAutoLoads to false

Then set the character by saying player.Character = script.StarterCharacter

Finally load the player’s character using player:LoadCharacter and it should work

2 Likes

loadcharacter cant be called locally

1 Like

You don’t need to do it in a local script if you want to change character for a specific player…unless only that player can see the new char?

1 Like

What? This cant be done serversided because if i add a startercharacter instance to starterplayer then that’ll apply for all players meaning it wont set startercharacter for specific players as the title says

1 Like

I don’t mean adding to starterplayer, you directly set the character with player.Character = script.StarterCharacter

1 Like

doesnt work:

local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
game.Players.CharacterAutoLoads = false
if plr.Name == "Polynovuh" or plr.Name == "Player1" then
	char = script.StarterCharacter
end
2 Likes

Load the character again with player:LoadCharacter

That’s why autoloads is false

1 Like

loadcharacter cant be called localy and i can just reset and the result is still the same

1 Like

I did say in post #8 that you need to do it a serverscript

1 Like

my studio is bugging out but ill test it in abit

1 Like

You need to use the server, you are really just creating a morph

you will need to modify it to fit your needs but this teaches you the basics

here is a good tutorial

3 Likes

You could have a server script that manually loads the player’s character.

For example, if the player is named Bob, then the script will clone a rig, parent it to workspace, and set their character value to that rig. If they’re not named Bob, just do player:LoadCharacter()

game:GetService("Players").PlayerAdded:Connect(function(player)
    if player.Name == "Bob" then
        local character = script.BobRig:Clone()
        character.Parent = workspace
        player.Character = character
    else
        player:LoadCharacter()
    end
end)

Oh, don’t forget to add a check for when the character dies too.

2 Likes

Yeah this is what I said in an earlier post

1 Like

these are morphs not starter characters

1 Like

you want the startercharacter to change depending on the player, its better to just morph the player on the server side

Aight I got it

game.Players.PlayerAdded:Connect(function(plr)
	if plr.Name == "MysteryX2076" then -- This is my user 
		plr.CharacterAdded:Wait()
		local ChangeToChar = game.ReplicatedStorage.Noob:Clone() -- Dummy I want to set my character to
		ChangeToChar.Name = "Dummy" -- Set the name to whatever you like
		plr.Character = ChangeToChar -- Most important step, change your character to dummy
		ChangeToChar.Parent = workspace -- Set the parent to workspace so we can see the change
	end
end)


Sorry for the confusion about loading character, had to run this through a few times :sweat:

2 Likes