Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by
Eman08 10
11 years ago

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!

0
What about for a certain team getting one? Eman08 10 — 11y

4 answers

Log in to vote
3
Answered by
trogyssy 221 Moderation Voter
11 years ago

This will work.

01local shirtid= --Put the ID here. No need to subtract one, the script does that
02local pantsid= --Put the ID here. No need to subtract one, the script does that
03 
04Game.Players.PlayerAdded:connect(function(p) p.CharacterAdded:connect(function()
05if p.Character:FindFirstChild("Shirt") then
06p.Character.Shirt:Destroy()
07end
08if p.Character:FindFirstChild("Pants") then
09p.Character.Pants:Destroy()
10end
11 
12local shirt=Instance.new("Shirt")
13shirt.ShirtTemplate="http://www.roblox.com/asset/?id="..(shirtid-1)
14shirt.Parent=p.Character
15 
16local shirt=Instance.new("Pants")
17pants.PantsTemplate="http://www.roblox.com/asset/?id="..(pantsid-1)
18pants.Parent=p.Character
19 
20end) end)
0
Danke Eman08 10 — 11y
0
Np trogyssy 221 — 11y
Ad
Log in to vote
0
Answered by 11 years ago

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.

1game.Players.PlayerAdded:connect(function(plr)
2    s = Player:FindFirstChild("Shirt")
3    if s then
4        s:Destroy()
5    end
6    Instance.new("Shirt").AssetID = IDhere
7end)

That should do it.

1
wait... when I put plr I meant to put Player. My bad, man. Ulrakid11 5 — 11y
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. Ulrakid11 5 — 11y
Log in to vote
-1
Answered by 11 years ago

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

0
@Ulrakid11 there is no AssetId property of RBX.lua.Shirt User#2263 0 — 11y
Log in to vote
-1
Answered by 11 years ago

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

Answer this question