[HELP] Char Command Not Working

Hi I Making A Char Command In My Admin System, Char Command Not Working Help Please

ERROR:
attempt to index number with ‘HumanoidDescription’

CODE:

local charplr = nil
			local changecharplr = nil
			local ErrorsTable = {}
			
			if arguments[2]:lower() == "all" then
				changecharplr = "all"
			elseif arguments[2]:lower() == "me" then
				changecharplr = plr
			elseif game.Players:FindFirstChild(arguments[2]) then
				changecharplr = arguments[2]
			else
				table(ErrorsTable,arguments[2])
			end
			
			local success, err = pcall(function()
				game:GetService("Players"):GetUserIdFromNameAsync(arguments[3])
			end)

			if success then
				charplr = game:GetService("Players"):GetUserIdFromNameAsync(arguments[3])
				changecharplr:LoadCharacterWithHumanoidDescription(charplr.HumanoidDescription)
			else
				print("error")
			end

Your error is fairly self-explanatory, you’re attempting to index a number with the key/field “HumanoidDescription”.

charplr = game:GetService("Players"):GetUserIdFromNameAsync(arguments[3])

This line of code returns and assigns a UserId to the variable named “charplr”. This is then directly followed by.

charplr.HumanoidDescription

You need to do something similar to the following.

local plr = game:GetService("Players"):FindFirstChild(arguments[3])
if plr then
	local char = plr.Character
	if char then
		local humanoid = char.Humanoid
		local description = humanoid.HumanoidDescription
	end
end