How can I replace the Player's Clothing?

Hello! I am currently making a cutscene for my game and in the cutscene, I want to replace the Player’s Shirt and Pants.

I thought it would be easy to program, however, for some reason in the cutscene the Player doesn’t have any clothes. The output doesn’t give me any errors.

The cutscene starts with a LocalScript firing a RemoteEvent. Then, a Server Script receives that and creates new clothing for the Player, fires the same RemoteEvent again, and then the cutscene plays on the client.

This is the Server Script that makes new clothing for the Player:

local DreamBarnCutsceneActivateRemoteEvent = game:GetService("ReplicatedStorage"):WaitForChild("DreamBarnCutsceneActivateEvent")

local TpPart = game.Workspace:WaitForChild("DreamCutsceneBarnCamParts"):WaitForChild("PlayerTpPart")

DreamBarnCutsceneActivateRemoteEvent.OnServerEvent:Connect(function(player)
	local Shirt = Instance.new("Shirt")
	local Pants = Instance.new("Pants")

	Shirt.Parent = player.Character
	Pants.Parent = player.Character

	Shirt.Name = "Shirt"
	Pants.Name = "Pants"

	Shirt.ShirtTemplate = "rbxassetid://17175930056"
	Pants.PantsTemplate = "rbxassetid://129459077"
	player.Character:WaitForChild("HumanoidRootPart").CFrame = TpPart.CFrame
	DreamBarnCutsceneActivateRemoteEvent:FireAllClients()
end)

Any help?

There’s an instance in the Humanoid called a HumanoidDescription with properties of accessory and clothing IDs, maybe you could use that?

local char = player.Character
local hum = char:WaitForChild("Humanoid")
local humDesc : HumanoidDescription = hum:WaitForChild("HumanoidDescription")
humDesc.Pants = 129459077 --If it's supposed to be a string just put quotation marks
humDesc.Shirt = 17175930056 --same thing here
1 Like

You could do:

game.Player.PlayerAdded:Connect(Function(Player)
Player.CharacterApperance = 0 --<--- you can create an avatar on a real roblox account, save it, and get its appernce. then put it here
end)

A few things you migt like about this:

  1. You have to have all the items for the avatar
  2. You must have this character saved at all times, otherwise, it will change to a bacon avatar.

You Could Also Use This:

game.Player.PlayerAdded:Connect(Function(Player)
Player.Character:FindFirstChild("Humanoid").Pants = 0 --<-- Enter Pants ID

Player.Character:FindFirstChild("Humanoid").Shirt= 0 --<-- Enter Shirt ID
end)
-------- You can repeat that with "Hair" ------------------------------