local button = script.Parent
local player = game.Players.LocalPlayer
button.MouseButton1Down:Connect(function()
if player then
local humanoid = player:FindFirstChild("Humanoid")
local height = humanoid:WaitForChild("BodyHeightScale").Value
if humanoid then
if humanoid:FindFirstChild("BodyHeightScale") then
humanoid.BodyHeightScale.Value = height - 0.05
end
end
end
end)
Title says it all. I’m having trouble with trying to scale my characters with textbuttons, and I keep getting the output error
“[Players.TritoNotTrito.PlayerGui.ScreenGui.TextButton.LocalScript:6: attempt to index nil with ‘WaitForChild’]”. I’ve tried several things, like using a local instead of the value (but that didn’t work and would cause problems with the other text button, which is supposed to make you taller). Help would be appreciated!