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

Change Clothe when Spawn?

So i want to create a script that change shirt , pant , hat when someone Spawn in the game but i cant find a way to do that so if you know tell me :D Thx

1 answer

The things you will need to learn about are listed below:

You can learn how to give a player hat here

Inside a script in game.ServerScriptService



local function PlayerAdded(Player)

	Player.CharacterAdded:Connect(function(Character) -- use an Anonymous function for this
		
		local Shirt = Character:WaitForChild("Shirt") -- will wait until Shirt is found
		local Pants = Character:WaitForChild("Pants") -- do the same for pants

		Shirt.ShirtTemplate = "rbxassetid://id" -- change id with the id of the shirt you want to use
		Pants.PantsTemplate = "rbxassetid://id" -- do the same as you would shirt but with pants
		
	end)

end

game.Players.PlayerAdded:Connect(PlayerAdded) -- when player joins the function PlayerAdded will call

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