How can i scale a player Client sided (only you can see your custom size)

  1. What do you want to achieve? I’m trying to make a players size increase based on a value but it needs to be client sided as if it weren’t, the game would be filled with people that are max size and stuff.

  2. What is the issue?
    Since it needs to be local, i cannot just do it the normal way by changing the scale values in the humanoid.

  3. What solutions have you tried so far? I have tried changing the Int Values in the humanoid for scale, but since its a local script, it didn’t do anything. I’ve also looked around for a bit and no one really had the same issue, there was one post but it didn’t have an answer and it was from a few years ago so it would probably be outdated even if there were a solution.

My current code:

local Value = script.Parent:WaitForChild("SizeValue")
local plr = game.Players.LocalPlayer


Value.Changed:Connect(function(v)
	if plr.Character and plr.Character.Humanoid then
		local scale = math.round(v / 10)
		local humanoid = plr.Character.Humanoid
		humanoid:WaitForChild('BodyDepthScale').Value = scale
		humanoid:WaitForChild('BodyHeightScale').Value = scale
		humanoid:WaitForChild('BodyWidthScale').Value = scale
		humanoid:WaitForChild('HeadScale').Value = scale
	end
end)
1 Like

Bump.
I would like to hear people’s ideas on this too. It becomes a pain with accessories when you can’t use scale. If I find a solution I’ll update.

I’m having a hard time understanding exactly what you mean. Could you clarify what issues you’re having modifying scale on the server?

Couldn’t you just put a LocalScript in CharacterScripts to achieve this locally?

Try using humanoid descriptions

2 Likes

Thank you for responses.

From what I can tell changing the HeadScale number in Humanoid/HumanoidDescription/HeadScale using a Local script has no visual effect on the player’s head.

It seems that they need to be done from a Server script to actual have a visual effect on the player.

What I was hoping to be able to do was to change the appearance of the player locally so only they would see the difference and others in the server would not.

I’m begining to think that this is not possible using the scale features and I will need to actually shrink the head Part and deal with head accessories seperate. Hope tgst makes sense now

Doesn’t that only work on the server?
The problem is no matter what I try, for all the things I’ve tried, it needs to happen on the server for it to change anything, so I’m looking for a workaround right now.

hey, any chance you found a solution for scaling characters on the client side (specifically head)?

I’m trying to change the headscale of a character in a viewportframe which is only client side, but no luck so far. Doing it on the server isn’t really an option as the avatar is under ‘worldmodel’ in a client’s viewportframe., changing it’s headscale or any other humanoidscale does nothing.

1 Like

Okay I got a hacked workaround working for my issue- it looks like you can scale the head for a char model on the client side in a viewportframe worldmodel ONLY when using ‘applyDescription’ , you can’t modify the humanoid HeadScale value directly as it will not do anything."
i.e.

local newDesc = Instance.new("HumanoidDescription")
newDesc.HeadScale = xxx
Humanoid:ApplyDescription(newDesc)

This will change the scale and update it in the viewport. However it seems to remove all bodycolors in the process, for ‘reasons’. Even if I make a copy from the original humanoid description and then modify its headscale and then apply it, it still resets the body colors.

I wasn’t able to resolve that bug, so I had to manually store the body colors from before applying the description with the updated headscale, then restore them after. Feels like this shouldn’t be necessary but that’s the only solution I found so far, below are those functions.

local function storeBodyColors(humanoid)
	local bodyColors = {}
	for _, bodyPart in ipairs(humanoid.Parent:GetChildren()) do
		if bodyPart:IsA("BasePart") then
			local color = bodyPart.Color
			bodyColors[bodyPart.Name] = color
		end
	end
	return bodyColors
end

-- Function to reapply the stored body colors
local function reapplyBodyColors(humanoid, bodyColors)
	for bodyPartName, color in pairs(bodyColors) do
		local bodyPart = humanoid.Parent:FindFirstChild(bodyPartName)
		if bodyPart and bodyPart:IsA("BasePart") then
			bodyPart.Color = color
		end
	end
end

You can visually change the Size of the Mesh inside of the Head object to achieve pretty much the same result, It will not change the hitbox, or anything like that as the Mesh is just visual.

-- this is just an example, this code depends on you having a Head variable --
local headMesh = Head:FindFirstChildOfClass("Mesh")
headMesh.Size *= 2 -- Doubles the size of the head VISUALLY

Edit: sorry, i figured out this doesn’t work on R15 as R15 has a MeshPart instead of a SpecialMesh inside of a Part.

I also figured out how to solve my original problem, you can scale your character by doing this:

CharacterModel:ScaleTo(2) -- 1 is default size for all characters no matter what. 
-- To my knowledge, all avatar types work, I only tested R6 and R15 though.
1 Like

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