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

How do I make it so when people join my game, they wear a certain shirt?

How do I make it so when people join my game, they wear a certain shirt?

I'm trying to make a new game, and I can't find out how. Please help, and thanks!

1 comment

0

What about for a certain team getting one?

4 answers

✓ Accepted answer

This will work.

local shirtid= --Put the ID here. No need to subtract one, the script does that
local pantsid= --Put the ID here. No need to subtract one, the script does that

Game.Players.PlayerAdded:connect(function(p) p.CharacterAdded:connect(function() 
if p.Character:FindFirstChild("Shirt") then
p.Character.Shirt:Destroy()
end
if p.Character:FindFirstChild("Pants") then
p.Character.Pants:Destroy()
end

local shirt=Instance.new("Shirt")
shirt.ShirtTemplate="http://www.roblox.com/asset/?id="..(shirtid-1)
shirt.Parent=p.Character

local shirt=Instance.new("Pants")
pants.PantsTemplate="http://www.roblox.com/asset/?id="..(pantsid-1)
pants.Parent=p.Character

end) end)

2 comments

0

Danke

0

Np

If I were you, I would remove their current one and either clone one in from lighting or insert a new one with a certain AssetID.

game.Players.PlayerAdded:connect(function(plr)
	s = Player:FindFirstChild("Shirt")
	if s then
		s:Destroy()
	end
	Instance.new("Shirt").AssetID = IDhere
end)

That should do it.

2 comments

1

wait... when I put plr I meant to put Player. My bad, man.

1

Also you should set the parent of the new shirt to player. I was typing too fast and didn't notice my silly mistakes.

Change their character's shirt's ShirtTemplate property to the asset id of the desired shirt template.

1 comment

0

@Ulrakid11 there is no AssetId property of RBX.lua.Shirt

Same with me but i want to know how to do it with the whole body instead of just one part

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