How to have local character changes?

hi all, before i start, this is not a request for someone to write me code. i just want an idea on how to make this and what services or methods i need to use.

how can i locally change other characters on one client? for example, i want all other characters besides the local players to be changed to something.

like the local player A will see their character, but player B and player C have random ones. on player B’s screen, they will have their character, but player A and player C have random ones.

is this possible? where do i start?

2 Likes

Via a LocalScript, you could loop through all of the Players that are currently in the game with Players:GetPlayers(), reference their Character models, and then make the desired changes.

To avoid making changes to the LocalPlayer, you could check if the Player it found on the current iteration of the loop does not equal the LocalPlayer to make sure the loop skips that player.

what if the local changes are complex? for example, what if i wanted to morph all players except the local one into another character?

1 Like

I’m pretty sure you could use a for loop on the players, choose the player you want the avatars to be, and use this function on the humanoid that’s :called ApplyHumanoidDescription()

2 Likes

By random ones, do you mean random players on the platform? Or like a set of random avatars you are going to make? And also, are both of the other players going to have the same different characters?

In the easiest case, I would probably start by just setting all characters to look the same, then I’d use :GetHumanoidDescriptionFromUserId and :ApplyDescription to apply their character to themselves in a local script (works better for r6). If you want to do it where you set the other two players characters to something else (would work better for r15 I think) you can use ApplyHumanoidDescription() on the two characters

2 Likes

You can’t, all changes of character appearance have to be done on server side such as applying Humanoid Descriptions or adding accessories.

However, there is a tricky work-around which would be to add multiple accessories into all players character in server side (different hairs, hats, decorations, clothes ect…), then do a random selection of accessories in client side and delete all accessories that didn’t get choosed.

The second work-around would be to put all others players character body part invisible, and delete all their current accessories in client side, then clone a preset of new body parts and other appearence things stored in ReplicatedStorage, and weld them to the invisible body part.

2 Likes

this makes my heart hurt.

thank u roblox for the limitations.

ill mark this as the solution.

That statement is not entirely accurate, since you can locally make changes to the appearances of other Characters without the usage of HumanoidDescriptions, although it is more limited.

However, it is true that added accessories wouldn’t be shown, and that HumanoidDescriptions cannot be applied from the client, as it displays the error of Humanoid::ApplyDescription() can only be called by the backend server.


For reference, I ran a quick test with the following code in a LocalScript (that was placed into the StarterPlayerScripts container) which confirms that some changes to the appearance of either the LocalPlayer or the Characters of other players in the game can be made without having it automatically replicate.

(On the left side of the image is Player1’s perspective, and the right side is Player2’s perspective)

local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer

local function updateCharacterAppearances()
	local LocalPlayerCharacter = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
	
	if LocalPlayer.Name == "Player1" then
		-- Example change to LocalPlayer to show that it doesn't replicate
		LocalPlayerCharacter:WaitForChild("Left Leg"):Destroy()

		-- Make changes to the appearance of Player2 (from Player1's Perspective)
		local Player2 = Players:WaitForChild("Player2")
		local Player2Character = Player2.Character or Player2.CharacterAdded:Wait()
		
		for _, item in Player2Character:GetChildren() do
			if item:IsA("Accessory") then
				item:Destroy()
			end
		end
		
	elseif LocalPlayer.Name == "Player2" then
		-- Example change to LocalPlayer to show that it doesn't replicate
		LocalPlayerCharacter:WaitForChild("Left Leg"):Destroy()
		
		-- Make changes to the appearance of Player 1 (from Player2's Perspective)
		local Player1 = Players:WaitForChild("Player1")
		local Player1Character = Player1.Character or Player1.CharacterAdded:Wait()
		
		for _, item in Player1Character:GetDescendants() do
			if item:IsA("BasePart") then
				item.Transparency = 0.25
			end
		end
		
	end
end

updateCharacterAppearances()

However, since the OP wants to make complex changes to all other Character models (rather than quick and simple property changes or object removals), I agree that the example workarounds you provided would be suitable for that use case:

1 Like

you cant change player’s client side but on server you can change a different styles on character like colors and etc…

1 Like

I was thinking that maybe you can get rid of all characters accessories and clothes client side, and then change their body colors to mimic clothes. I think that is possible even with the limitations because it’s just deleting stuff and changing colors.

Also delete body part meshes so they all have the regular square bodies.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.