this = script.Parent this.MouseClick:connect(function(plr) local char = game.Workspace:WaitForChild(plr.Name) plr.leaderstats.Growth.Value = plr.leaderstats.Growth.Value +100 char.Humanoid.BodyWidthScale.Value = char.Humanoid.BodyWidthScale.Value *2 char.Humanoid.BodyHeightScale.Value = char.Humanoid.BodyHeightScale.Value*2 char.Humanoid.BodyDepthScale.Value = char.Humanoid.BodyDepthScale.Value*2 this.Parent.Parent:Destroy() end)
-- Declaration Section -- //Game Services local Workspace = game:GetService("Workspace") -- //Part Location local Part = Workspace:WaitForChild("Part") local ClickDetector = Part:WaitForChild("ClickDetector") -- //Variables local Number = 2 -- Processing Section local function ChangeHumanoidProperties (Player) local PlayerName = Workspace:WaitForChild(Player.Name) print(PlayerName) local Humanoid = PlayerName:WaitForChild("Humanoid") print(Humanoid) Humanoid.BodyWidthScale.Value = Humanoid.BodyWidthScale.Value * Number Humanoid.BodyHeightScale.Value = Humanoid.BodyHeightScale.Value * Number Humanoid.BodyDepthScale.Value = Humanoid.BodyDepthScale.Value * Number end -- Connecting Section Part.ClickDetector.MouseClick:Connect(ChangeHumanoidProperties)
Part
to connect with the Click Detector
WaitForChild()
for Humanoid
Magic Numbers
in your code; i.e, declared value.Thats about it. Let me know if the error still persists.
I think it is because you using wrong humanoid rig type.
So there are two types of character rig one is R6 he older and the newer on R15
The R6 Rig doesn't have scaling properties only the R15 Rig has that.
What you should do is set game settings to make only R15 allowed
Scroll to game setting it show how to set the game to R15 only https://wiki.roblox.com/index.php?title=R15_Compatibility_Guide
Exstra info http://wiki.roblox.com/index.php/API:Class/Humanoid
And make sure there is no error in code.