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.
01 | local shirtid = --Put the ID here. No need to subtract one, the script does that |
02 | local pantsid = --Put the ID here. No need to subtract one, the script does that |
03 |
04 | Game.Players.PlayerAdded:connect( function (p) p.CharacterAdded:connect( function () |
05 | if p.Character:FindFirstChild( "Shirt" ) then |
06 | p.Character.Shirt:Destroy() |
07 | end |
08 | if p.Character:FindFirstChild( "Pants" ) then |
09 | p.Character.Pants:Destroy() |
10 | end |
11 |
12 | local shirt = Instance.new( "Shirt" ) |
13 | shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=" ..(shirtid- 1 ) |
14 | shirt.Parent = p.Character |
15 |
16 | local shirt = Instance.new( "Pants" ) |
17 | pants.PantsTemplate = "http://www.roblox.com/asset/?id=" ..(pantsid- 1 ) |
18 | pants.Parent = p.Character |
19 |
20 | end ) end ) |
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.
1 | game.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 |
7 | end ) |
That should do it.
Change their character's shirt's ShirtTemplate property to the asset id of the desired shirt template.
Same with me but i want to know how to do it with the whole body instead of just one part