Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Character Height Changer not working?

Hello! So I have a Team Change Gui, and I want the player to change sizes when they press one of the buttons. For some reason, it doesn't work. Can you help me identify my problem?

function PlayerSize(player) local SizeValue = 0.5

script.Parent.Button.MouseButton1Click:Connect(function(player)
local humanoid = player.Character.Humanoid
if humanoid then
	if humanoid:FindFirstChild("BodyHeightScale") then
		humanoid.BodyHeightScale.Value = SizeValue
	end
end

end) end

1 answer

✓ Accepted answer

Make sure this is in a local script also make sure you get the player and the character by doing the below code. And make sure it's in this is in a local script parented in startergui


script.Parent.Button.MouseButton1Click:Connect(function(player)
	wait()
	if game.Players.LocalPlayer then
		local character = game.Players.LocalPlayer.Character
		if character then
			local humanoid = character:FindFirstChild("Humanoid")
			if humanoid then
				if humanoid:FindFirstChild("BodyHeightScale") then
					humanoid.BodyHeightScale.Value = (.5)
				end
			end
		end
end
end) 

1 comment

0

Thank you so so much! I can't thank you enough.

This discussion is preserved as it was. New answers, comments, and votes are closed.