Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to have certain players load a custom character?

I was wondering on how I could have custom character load for a certain player. What I mean by this is that when a regular player joins the game their character loads but when a certain player joins they load a custom character.

--Normal players will have their own character-- https://gyazo.com/e43617cca60c61afefecbe756acdbfbf

--Certain players will have this character--

https://gyazo.com/0760483b335c12927946db6d407a827a

I was thinking about something like in the script you have to manually put the names their like "player1,player2,player3" but I think it doesn't matter.

If anyone can help me that would be great!

1 answer

You could make a table

local NewCharacter{}

Now, you can make a code to change the player's Avatar

game.Players.PlayerAdded:Connect(function(player)
	--//Here do some code e.g.
	game.Workspace.Part.Touched:Connect(function(hit)
		table.insert(NewCharacter, hit.Parent.Name)
	end)
	for i,v in pairs(NewCharacter) do
		if player.Name = v then
			--//Now you can change the player's appearance to whatever you like
		end
	end
end)

It would be ideal to put the custom character in replicated storage, this way you can clone the parts into the player. First, you will have to set the player's original parts(left arm, right arm, etc.) transparency to 1

Full Script

local NewCharacter{}

game.Players.PlayerAdded:Connect(function(player)
	--//Here do some code e.g.
	*game.Workspace.Part.Touched:Connect(function(hit)
		table.insert(NewCharacter, hit.Parent.Name) --inserts player's name to the table
	end)*
	for i,v in pairs(NewCharacter) do --goes through the table called NewCharacter
		if player.Name = v then --// checks if the name of the player's name is one of the value's of the NewCharacter table
			--//Now you can change the player's appearance to whatever you like
		end
	end
end)

This line table.insert(NewCharacter, hit.Parent.Name) inserts the name of the parent of hit. hit may be a leg or arm or whatever touched the part. The parent of hit would be the model of the player in workspace. The name of the parent of hit would be the name of the model which is the player's name

7 comments

0

localscript or script? And where do I put the script? serverscriptservice?

0

I need a little more help with setting this up, I'm not 100% familiar with this

0

What are you confused with

0

I'm just confused with what to put the script on and where to put the script

0

I'm also confused on where to write the players name, I'm sorry

0

Is there another way I can message you to make this easier

0

do you have discord?

This discussion is preserved as it was. New answers, comments, and votes are closed.