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

How to make your character as someone?

I want to know on how to prevent your character from being you. Like in the murder games, but I'm not into making murder games. So, I got this model of a hat. I want it to be the default hat of everyone who joins my place. If possible, also the clothing. I just want to know the things I have to do. I want to figure out and do it myself. Please help me. A basic script would also help.

1 answer

✓ Accepted answer

Well what I did is make a localscript and put it inside the StarterGui because that way the script will automatically run each time the player respawns.

--To modify the player, you may use the following code
game.Players.LocalPlayer.Character.Shirt --or whatever you want to access inside the Character

To give everyone a hat, you would want to clone it into the character. What I did in my script was have a model in the workspace where I stored all the things I want to clone over to the player.

I also used the following code to remove some of the unwanted contents the player spawns with

for a,c in pairs(game.Players.LocalPlayer.Character:GetChildren()) do --Make a list of all the things inside the LocalPlayer's Character. "a" is the index value and "c" is the actual element.
			if (c.className == "Hat") or (c.className == "CharacterMesh") then
			c:Destroy() --Get's rid of the hat or charactermesh
end

Here is an article on pairs loop if needed.

Hope you figure it out.

3 comments

0

Where's the second end on the second chunk of code?

0

It's fine. I think I figured it out. I'm experimenting the script so I could learn some more.

0

Sorry, I cut it out and forgot to add it back in.

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