Change character size without separating parts from eachother

I am trying to make a little part that when you click it, it makes your character smaller, so that you can fit under a bed and talk to smaller NPCs or “toy soldiers” as referenced to in the game.

What happens when you press the button
image

script.Parent.MouseClick:Connect(function(plr)
	local parts = plr.Character:GetChildren()
	for i,v in pairs(parts) do
		if v:IsA("BasePart") then
			v.Size *= Vector3.new(.5,.5,.5)
		end
		if v:IsA("Accessory") then
			v.Handle *= Vector3.new(.5,.5,.5)
		end
	end
end)

What am I doing wrong? I have a general idea, because I know the parts have to be repositioned but I’m not sure how to and I can’t find any source on how to either.

An extremely simple approach to this problem is to call :ScaleTo on the player’s character.

1 Like

The Player’s Humanoid has something like that, you can change those by a script.

Player.Character.Humanoid.HeadScale.Value *= 0.5
Player.Character.Humanoid.BodyDepthScale.Value *= 0.5
Player.Character.Humanoid.BodyWidthScale.Value *= 0.5
Player.Character.Humanoid.BodyHeightScale.Value *= 0.5

But the problem is that, those values are used by the server.
So,

Event.OnServerEvent:Connect(function(Player, Size)
    Player.Character.Humanoid.HeadScale.Value *= Size
    Player.Character.Humanoid.BodyDepthScale.Value *= Size
    Player.Character.Humanoid.BodyWidthScale.Value *= Size
    Player.Character.Humanoid.BodyHeightScale.Value *= Size
end)
Event:FireServer(0.5)

Use Character:ScaleTo().

script.Parent.MouseClick:Connect(function(plr)
	plr.Character:ScaleTo(0.5)
end)

Why do I need an event if the script I sent is a server script?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.