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

How do i put clothing on a player when the player joins?

Asked by 6 years ago

When the player enters the game how do i make them wear a outfit that i choose?

2 answers

Log in to vote
0
Answered by
Nikkulaos 229 Moderation Voter
6 years ago
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
for i,v in pairs (character:GetChildren() do
if v.ClassName == "Shirt" or v.ClassName == "Pants" then
v:remove()
end
end
local Shirt = put shirt destination here:Clone()
Shirt.Parent = character
local Pants = put pants destination here:Clone()
Pants.Parent = character
end)
end)
0
indent pls abnotaddable 920 — 6y
Ad
Log in to vote
0
Answered by
Prestory 1395 Moderation Voter
6 years ago
shirtid = -- put number of shirt in here
pantsid = -- put number of pants in here

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
if character:findFirstChild("Shirt") ~= nil then
character.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id="..shirtid
else
local newshirt = Instance.new("Shirt")
newshirt.Parent = character
newshirt.ShirtTemplate = "http://www.roblox.com/asset/?id="..shirtid
end
if character:findFirstChild("Pants") ~= nil then
character.Pants.PantsTemplate = "http://www.roblox.com/asset/?id="..pantsid
else
local newpants = Instance.new("Pants")
newpants.Parent = character
newpants.PantsTemplate = "http://www.roblox.com/asset/?id="..pantsid
end
end)
end)

Accept if helped

0
me and your answer is basically the same, but yours is just longer. Nikkulaos 229 — 6y
0
@Nikkulai His solution is a bit better. If only he used non-deprecated stuff and some indentation, his answer will be perfect. Mineloxer 187 — 6y
0
yes lol Nikkulaos 229 — 6y
0
I made my one easier to understand you just have to type the number in where it says shirts id and pants id at the top Prestory 1395 — 6y

Answer this question