Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to make a auto-assign clothes?

Does anyone know how to script an auto-assign clothes, so when players join a game, it automatically makes them wear a certain type of clothing ?

1 answer

game:GetService('Players').PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(character)
		character.Humanoid.MaxHealth = math.huge
		character.Humanoid.Health = math.huge
		local ShirtID = 0
		local PantsID = 0
		local shirt = character:WaitForChild('Shirt',5)
		local pants = character:WaitForChild('Pants',5)
		if character["Shirt Graphic"] then
			character["Shirt Graphic"]:Destroy()
		end
		if not shirt then
			local shirt = Instance.new('Shirt',character)
			shirt.ShirtTemplate = "rbxassetid://"..ShirtID
		elseif not pants then
			local pants = Instance.new('Pants',character)
			pants.PantsTemplate = "rbxassetid://"..PantsID
		end
		
		shirt.ShirtTemplate = "rbxassetid://"..ShirtID
		pants.PantsTemplate = "rbxassetid://"..PantsID
	end)
end)

2 comments

0

don't forget to remove t-shirts

0

Thanks!

This discussion is preserved as it was. New answers, comments, and votes are closed.