My character head resizing script is not functioning as intended

  1. What do you want to achieve?

I was following a tutorial on how to increase the size of the character relative to the leaderstats. I am currently trying to get the player head to increase in size when the leaderstats value increases

  1. What is the issue?

Right now, the GUI buttons that I have update the leaderstats, but the size of the head does not increase with the code I have. The script below is the resize script I got from the tutorial and I have it in a script within ServerScriptService.

while wait(.5) do
local children = game.Players:GetChildren()
for i = 1, #children do
	
	if children[i].Character ~= nil then
		local hum = children[i].Character.Humanoid
	hum.HeadScale.Value = children[i].leaderstats.Smarts.Value +1
	print("working")
	end
	
end

end

The game is printing the “working” text, but the HeadScale is not increasing.

  1. What solutions have you tried so far?
    I have tried by best to recheck my work, but there are no errors that I can find.

Any help would be much appreciated. Thanks!

1 Like

Children[i] is the player, but there is a cleaner way to write this.

for _,Player in pairs(game.Players:GetChildren()) do
Player.leaderstats.Smarts.Changed:Connect(function()
if Player.Character then
Player.Character[“Humanoid”].HeadScale.Value = Player.leaderstats.Smarts.Value + 1
end
end)
end

That being said, I don’t think HeadScale has the intended use that you are trying to use it for, I think it is for R15 character customization.

1 Like

When I print that, I get my own character name, BasePair

1 Like