Applying humanoid clothing/etc on the client end

I know ApplyDescription can only work server side, but is there anyway I can do this from the client?

Reason being, each client has a local dummy, which I want to change the dummies clothing/hair/etc (HumanoidDescription) so each client would see their own customised dummy and not somebody elses.

So is there a work around??

local PlayersHumanoid = GetCharacterAppearance:InvokeServer() -- Get players appearance
print(PlayersHumanoid) -- returns nil??
Dummy.Humanoid:ApplyDescription(PlayersHumanoid) -- set the dummy to look like the player

Problem I also have is returning a HumanoidDescription.

function GetCharacterAppearance.OnServerInvoke(player)
	local HumanoidDescription = Players:GetHumanoidDescriptionFromUserId(player.UserId)
    print(HumanoidDescription ) --prints HumanoidDescription
	return HumanoidDescription
end

So it shouldn’t be printing nil

2 Likes

It is grabbing the value, not the reference to the description. The value is stored locally, and is not available to the client.

It’s like doing Instance.new(‘Folder’) on the server and sending to the client; The client does not have that reference; It is not replicated.

Try this:

--Client

 local PlayersHumanoid = game.Players:GetHumanoidDescriptionFromUserId(GetCharacterAppearance:InvokeServer())-- Get players appearance
print(PlayersHumanoid)
Dummy.Humanoid:ApplyDescription(PlayersHumanoid) -- set the dummy to look like the player
--Server
function GetCharacterAppearance.OnServerInvoke(player)
	return player.UserId
end

This should solve the second problem.

That wont work.
ApplyDescription can’t be called from the client

Sorry, read over the first part. Create a dummy on the server, apply the description to it, then place the dummy titled the player’s name in ReplicatedStorage. That way, the client can then access it, clone and place it into the workspace locally, solving your problem.

1 Like

That’s not what my question is about…

The problem here is when you call GetHumanoidDescriptionFromUserId it stores the return value on the server, inaccessible to be referenced the client. Due to this, when you try to reference it on the client where it’s non-existant it simply won’t work.

To get around this, you’ll just need to parent the returned value to somewhere accessible to the client. Perhaps you could create a folder for each client in ReplicatedStorage and parent the HumanoidDescription to there before sending it to the client. Or, here’s an example where it’s just simply parented to ReplicatedStorage:

function GetCharacterAppearance.OnServerInvoke(player)
	local HumanoidDescription = Players:GetHumanoidDescriptionFromUserId(player.UserId)
	HumanoidDescription.Parent = game.ReplicatedStorage --make it accessible to the client
	print(HumanoidDescription) --prints HumanoidDescription
	return HumanoidDescription
end

Without any changes to the client, this change to the server will mean the client now has access to the HumanoidDescription.

EDIT: This still doesn’t seem to let you apply the HumanoidDescription to the dummy, it says it can only be done on the server.

The methods themselves can only be called on the server. There is no possible workaround you can use in this scenario. You will have to manually apply clothes to the client character view model.

cc @colbert2677

Couldn’t I clone the HumanoidDescription to RepStorage from server, then from the client, remove the Dummy’s HumanoidDescription and replace it with the newer one??

No, that wouldn’t do anything. HumanoidDescriptions don’t activate if they’re placed inside Humanoids, they have to explicitly be applied via the methods. The methods have a strict lock to be usable by the server only. HumanoidDescriptions on the client are out of the question.

Hmm ok :confused: can I still use GetCharacterAppearanceInfoAsync from the client and use the assets returned from that to put on the dummy?

Yep, both GetCharacterAppearanceAsync and GetCharacterAppearanceInfoAsync can be used on the client. You can parent models out of GetCharacterAppearanceAsync to your client character, or convert the information retrieved from GetCharacterAppearanceInfoAsync into assets for use.

I’m using GetCharacterAppearanceInfoAsync as that seems to be the easiest way to do what I’m trying to do. Stuck with trying to require the specific asset items tho

Thread is here

Another problem,

[InsertService cannot be used to load assets from the client]

Why the hell can’t half these services be called from the client?? Making my life incredibly difficult :angry:

InsertService was restricted for use on the client due to security concerns. There are several update articles regarding these changes. You will have to insert items from the server.

Items inserted by InsertService also do not automatically replicate. You will have to parent any item you insert to ReplicatedStorage in order for it to replicate, then pass the item off to the client.