Change Body Size with a TextButton

Hello, I’m trying to make a button that when clicked changes the player’s body size
This is the script:

script.Parent.MouseButton1Click:Connect(function()
	local Humanoid = game.Players.LocalPlayer.Character.Humanoid
	local HS = Humanoid.HeadScale
	local BDS = Humanoid.BodyDepthScale
	local BWS = Humanoid.BodyWidthScale
	local BHS = Humanoid.BodyHeightScale
		
	HS.Value = HS.Value * 2
	BDS.Value = BDS.Value * 2
	BWS.Value = BWS.Value * 2
	BHS.Value = BHS.Value * 2
end)

It is not working, can you help me?

Important details that can help:

The type of animation is R15
CanLoadCharacterAppearance is false

2 Likes

Just use Humanoid I think it would work.

for example
local Hum = game.Players.LocalPlayer.Character.Humanoid
Hum.HeadScale.Value = Hum.HeadScale.Value * 2

[11:55:19.599 - HeadScale is not a valid member of Humanoid]

Try Humanoid:WaitForChild(HeadScale, 60).Value = 2

This script is working for me. Is this code placed in a local script or a script?

It is in a localscript inside a textbutton

[12:05:45.740 - Argument 1 missing or nil]

Then I don’t know what’s wrong, maybe someone else can help.

Ok thank you for trying helping me

Yeah the script still works for me… maybe try adding a WaitForChild

.Character:WaitForChild("Humanoid")

If it still doesn’t work, when testing, is your character R15 or R6? Also, is the output saying anything?

R15
CanLoadAppareance its false
im gonna test it

Output: [12:12:51.312 - Argument 1 missing or nil]

When you have Player.CanLoadCharacterAppearance set to false, as you know you spawn as a default Roblox humanoid. Becuase it’s not loading your character appearance, it has no need for Rthro body scalar values, meaning those values are not in your humanoid, as seen here.

image

What you are going to have to do is create all the body scale values by hand, name it properly, and parent it to the character’s humanoid. Only then will you be able to change the values and it will scale properly.

how can i do that? i never did it befor

local hum = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")

local headScale = Instance.new("NumberValue")
headScale.Name = "HeadScale"
headScale.Parent = hum
headScale.Value = 3

image

oh
should i put it in the script of when the player joins and the load appareance is set to false?

i put it in the textbutton script thank u