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!
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!
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)
Danke
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.
wait... when I put plr I meant to put Player. My bad, man.
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.
@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.
1 comment
What about for a certain team getting one?