Hello everyone, I am trying to make a button where if you click once it scales your character down to like the size of a kid. this is what i have but it keeps erroring.
-- Reference the button you want to click to resize the character
local resizeButton = script.Parent -- Change 'script.Parent' to the path of your button
-- Reference your character
local character = game.Players.LocalPlayer.Character
-- Function to resize the character down
local function resizeCharacter()
-- Modify the character's size here
character:FindFirstChild("Humanoid").BodyHeightScale = 0.5 -- Adjust the scale as needed
character:FindFirstChild("Humanoid").BodyWidthScale = 0.5 -- Adjust the scale as needed
character:FindFirstChild("Humanoid").BodyDepthScale = 0.5 -- Adjust the scale as needed
end
-- Connect the button click event to the function
resizeButton.MouseButton1Click:Connect(resizeCharacter)
The good old “BodyHeightScale” is not a valid member of workspace.username.Humanoid!!! Yes so these scale factors are ValueBases, means you have to do humanoid.BodyHeightScale.Value = number; Idk why but this error always tricks me up as well.
Alternatively you can use the humanoid:GetAppliedDescription() and then description.BodyWidth = xxx then humanoid:ApplyDescription(description) Although this is inconvenient when you’re trying to tween the scales.