45Fox54
(Rapha)
August 10, 2020, 2:51pm
#1
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
45Fox54
(Rapha)
August 10, 2020, 2:55pm
#3
[11:55:19.599 - HeadScale is not a valid member of Humanoid]
Try Humanoid:WaitForChild(HeadScale, 60).Value = 2
QUlCKRED
(QUlCKRED)
August 10, 2020, 2:59pm
#5
This script is working for me. Is this code placed in a local script or a script?
45Fox54
(Rapha)
August 10, 2020, 3:03pm
#6
It is in a localscript inside a textbutton
45Fox54
(Rapha)
August 10, 2020, 3:06pm
#7
[12:05:45.740 - Argument 1 missing or nil]
Then I don’t know what’s wrong, maybe someone else can help.
45Fox54
(Rapha)
August 10, 2020, 3:09pm
#9
Ok thank you for trying helping me
QUlCKRED
(QUlCKRED)
August 10, 2020, 3:10pm
#10
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?
45Fox54
(Rapha)
August 10, 2020, 3:11pm
#11
R15
CanLoadAppareance its false
im gonna test it
45Fox54
(Rapha)
August 10, 2020, 3:13pm
#12
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.
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.
45Fox54
(Rapha)
August 10, 2020, 3:17pm
#14
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
45Fox54
(Rapha)
August 10, 2020, 3:32pm
#16
oh
should i put it in the script of when the player joins and the load appareance is set to false?
45Fox54
(Rapha)
August 10, 2020, 3:42pm
#17
i put it in the textbutton script thank u