Is there a way to change the model of a specific player when they join, without affecting future players?

Hello,

I have a script that I had in ServerScriptService to clone a model and put it in StarterPlayer once the player with a certain UserId joins. The problem however was that after that player joined, anyone that followed would also be his model.

I figured this was because it wasnt in a local script but when I change over to a local script, it doesn’t perform the function at all with no error.

game.Players.PlayerAdded:Connect(function(Player)
	local uid = 328989149
	if Player.UserId == uid then
		local model = workspace:WaitForChild("Characters"):WaitForChild("StarterCharacter"):Clone()
		model:Clone()
		model.Parent = game.StarterPlayer
	elseif Player.UserId ~= uid then
		return
	end
end)

Im still relatively weak in scripting but I am trying to figure out things on my own and for the most part I have. But for some reason I cant seem to understand what I am doing wrong here. Help is appreciated, thank you.

Hello! Is the model you’re trying to turn this specific player into a custom character, or a Roblox character (R15/R6)?

1 Like

Hi, Its honestly a gag for one of my friends to see rather than something im putting a lot of effort into so it would just be a model of his character that I rotated several parts for, it would be R6.

So you modified the character itself? Does the changes show up when you play it in-game?

I was thinking if you could try using the HumanoidDescription object to manually type in all the accessories, body parts and whatnot, before using Humanoid:ApplyDescription, though I’m not sure if this is what you have in mind.

1 Like

Sorry for the late response, Ive been trying to figure out work related stuff, Ill provide you an example of what I have, semi-like the idea im aiming for.

game.Players.PlayerAdded:Connect(function(Player)
	local uid = 328989149
	if Player.UserId == uid then
		local keith = workspace:WaitForChild("Characters"):WaitForChild("StarterCharacter"):Clone()
		keith:Clone()
		keith.Parent = game.StarterPlayer
	elseif Player.UserId ~= uid then
		return
	end
end)

This is under a local script. I have tried it from ServerScriptService in which it does work, but the people that follow after also receive it. I am not too knowledgeable on scripting but would love to understand how to make this work.

image
The image shown here is of an R6 rig, I do attempt to recreate this with the specific persons avatar but im sure it goes hand in hand as long as its R6. Thank you for your help.

–EDIT-- I changed the script back to ServerScriptService from a local script to be able to show you the photo of the model ingame.

2 Likes

Hello I believe there is a way that you can change it but I’m not sure :thinking:

2 Likes

Hey, unfortunately no one has swooped in to save me haha. I’d really appreciate your help when you get the chance. Thank you :slight_smile:

1 Like

Can’t you just clone the model and set the target player’s Character property to it?

It doesnt seem to be working.

game.Players.PlayerAdded:Connect(function(Player)
	local uid = 100577613
	if Player.UserId == uid then
		local Model = workspace:WaitForChild("Characters"):WaitForChild("Model"):Clone()
		Model.Parent = Player.Character
		Player.Character = Model
	end
end)