How do you make humanoid size increase from the click of a gui button

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Get a humanoids size to increase when you click a gui button (in a local script)

  2. What is the issue? It keeps saying “Humanoid is not a valid member of Model…”
    This is my script so far:

local player = game:GetService(“Players”).LocalPlayer
local char = player.Character or player.CharacterAdded:wait()

local human = char.Humanoid

script.Parent.MouseButton1Click:Connect(function()

human.Size = human.Size + game.Players.LocalPlayer.leaderstats.Rebirths.Value

end)

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I have looked on the devforum but none of the questions suited my case, I have tried switching around the way that the script was made but nothing worked.

Hey, so if this is a case of “Humanoid is not a member of”, this could possibly mean that “Humanoid” has not loaded yet. Replace the 3rd line with:

local human = char:WaitForChild("Humanoid") -- this will just wait for humanoid to exist

Hopefully this fixes your issue.

1 Like

i think humanoid dont have a size property do you mean a player’s character getting bigger when da player clicked a ui button?

2 Likes

this values

try,

local Player = script.Parent.Parent.Parent.Parent
local Character = Player.Character
local Humanoid = Character:WaitForChild("Humanoid")

local Amount = Player:FindFirstChild("leaderstats").Rebirths.Value

script.Parent.MouseButton1Click:Connect(function()
	Humanoid.BodyDepthScale.Value += Amount
	Humanoid.BodyHeightScale.Value += Amount
	Humanoid.BodyWidthScale.Value += Amount
	Humanoid.HeadScale.Value += Amount	
end)

use server script cuz its not sided by server means other players cant see da local character increases size

2 Likes

You should have a local script and remote event instead of a server script, server side should never interact with playergui.

3 Likes

It works, but when I try to change the rebirths value, it does the same amount as before. Also I tried making it so a leaderstats value would go up, but that didn’t work either.

oh just put the amount line inside da function so it will be updated mb i thought it justa permanent value

like this

local Player = script.Parent.Parent.Parent.Parent
local Character = Player.Character
local Humanoid = Character:WaitForChild("Humanoid")

script.Parent.MouseButton1Click:Connect(function()
	
	local Amount = Player:FindFirstChild("leaderstats").Rebirths.Value
	
	Humanoid.BodyDepthScale.Value += Amount
	Humanoid.BodyHeightScale.Value += Amount
	Humanoid.BodyWidthScale.Value += Amount
	Humanoid.HeadScale.Value += Amount	
end)
1 Like

It didn’t change anything lol-

nye you might change the value in da client try changing the value in da server and by clicking this
Untitled

Yeah that worked. I still down know how I am going to add in the leaderstats thing though. Should I do it in a different script?

I tried this and it worked, thank you for your help!