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
10 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 — 10y

4 answers

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

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)
0
Danke Eman08 10 — 10y
0
Np trogyssy 221 — 10y
Ad
Log in to vote
0
Answered by 10 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.

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.

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