HumanoidDescription error

using GetHumanoidDescriptionFromUserId while testing multiple player in studio return a error id

the function work normaly and in game but error whit multiple test client in studio
saying that the player id are invalid

That’s because, in the client test, the IDs of the players are in the minus, which the function does not support.

image
image

To prevent errors, just add a simple if statement to check if the user’s id is above 1.

Like this:

if player.UserId > 0 then
   -- GetHumanoidDescription Code
end
1 Like

how about i pcall it and return a new humanoid description witch can also prevent error if the function stop responding… since i use it alot for my custom respawn system

local Description
local success, Statement = pcall(function()
Description = Players:GetHumanoidDescriptionFromUserId(Player.UserId)
end)
if not success then
Description = Instance.new(“HumanoidDescription”)
end