Maker player Shrink

I’m trying to achieve a system that when you click a button on a UI the player shrinks. I’ve looked at a couple of different examples but can’t get it to work.

My code:

 script.Parent.Shrink.TextButton.MouseButton1Click:Connect(function(Player)
    local Humanoid = Player.Parent:FindFirstChild("Humanoid")
		if Humanoid then
			Humanoid.HeadScale.Value = 0.3
			Humanoid.BodyDepthScale.Value = 0.3
			Humanoid.BodyWidthScale.Value = 0.3
			Humanoid.BodyHeightScale.Value = 0.3
			Humanoid.BodyProportionScale.Value = 0.3
 end)
1 Like

Maybe try this instead?


script.Parent.Shrink.TextButton.MouseButton1Click:Connect(function(Player)
    local Humanoid = Player.Character:FindFirstChild("Humanoid")
		if Humanoid then
			Humanoid.HeadScale.Value = 0.3
			Humanoid.BodyDepthScale.Value = 0.3
			Humanoid.BodyWidthScale.Value = 0.3
			Humanoid.BodyHeightScale.Value = 0.3
			Humanoid.BodyProportionScale.Value = 0.3
        end
end)

Also, to get the Character of the player, just simply use Player.Character and not Player.Parent because there are no players inside the Character

1 Like

I’ve actually just worked out how to do it but thank you very much for your help.