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.