Shirt ID not being added to the HumanoidDescription

I am trying to create a system where a player can input the ID of a piece of clothing on the catalog and add it to their character. However, my attempt at doing so only leads to the value of the shirt being set to 0. Here is my code.

-- LOCAL SCRIPT

local shirtBox = script.Parent.Parent.Parent.ShirtBox
local fireShirt = game:GetService("ReplicatedStorage").Remotes.FireShirt
local player = game:GetService("Players").LocalPlayer

script.Parent.InputBegan:Connect(function(input) -- Button being pressed down
	if input.UserInputType == Enum.UserInputType.MouseButton1 then
		local shirtBoxText = tonumber(shirtBox.Text)
		fireShirt:FireServer(player, shirtBoxText)
	end
end)

-- SERVER SCRIPT

local repstorage = game:GetService("ReplicatedStorage")
local remotes = repstorage.Remotes
local fireShirt = remotes.FireShirt

fireShirt.OnServerEvent:Connect(function(player, shirtboxtext)
	local character = player.Character
	local humanoid = character.Humanoid
	local humanoidDescription = humanoid:GetAppliedDescription()
	humanoidDescription.Shirt = shirtboxtext
	humanoid:ApplyDescription(humanoidDescription)
end)

Here is a video of my issue.

Don’t send the player as the first argument; Roblox does that automatically (just send shirtBoxText). What your event connection looks like is:

RemoteEvent.OnServerEvent:Connect(player, player, shirtboxtext)

The player argument is only required for RemoteEvent:FireClient

2 Likes

It’s always the silliest mistakes I end up making. Thank you!