Scaling system acting weird

Currently I am making a scaling system with the ‘Handles’ instance. It is for some reason scaling both sides of a part when I select one side, though.
Video:


Location:
Screen Shot 2023-01-07 at 4.02.11 PM
Code:

local scaleHandle = script.Parent
local block = script.Parent.Adornee
scaleHandle.MouseDrag:Connect(function(face, distance)
	if face == Enum.NormalId.Left or face == Enum.NormalId.Right then
		workspace[block.Name].Size += Vector3.new(distance, 0, 0)
	end
	if face == Enum.NormalId.Top or face == Enum.NormalId.Bottom then
		workspace[block.Name].Size += Vector3.new(0, distance, 0)
	end
	if face == Enum.NormalId.Front or Enum.NormalId.Back then
		workspace[block.Name].Size += Vector3.new(0, 0, distance)
	end
end)

Unfortunately, your video didn’t quite load for me. Is the Script local? That would be needed instead of a server script. You also need to add where it changes the position along with the size, that’s how you can replicate the movement of 1 side only.

If I remember correctly, I could be wrong, the distance to Change Positions needs to be half of the size distance change

Example:

local SizeChange = 50
Part["Size"] += Vector3.new(0, SizeChange, 0); Part["Position"] += Vector3.new(0, SizeChange / 2, 0);

to scale you should use this:

local Dist = math.round(distance/increment)*increment
print(target, set, face, distance)
target.Size = oldSize+oldSize*Vector3.FromNormalId(face)*Dist

Where oldSize is obviously the initial/old size of the part and increment is the amount of studs to increase by. This eliminates the need for the if statements

What are the target and set things?

Target is in this case

It’s just the part you want to resize

This isn’t important. Didn’t mean to have that there!

local scaleHandle = script.Parent
local block = script.Parent.Adornee
scaleHandle.MouseDrag:Connect(function(face, distance)
	local oldSize = block.Size
	local increment = 1
	local Dist = math.round(distance/increment)*increment

	block.Size = oldSize+oldSize*Vector3.FromNormalId(face)*Dist
end)

Uhhh

For some reason, it still acts pretty buggy.
Code:

local scaleHandle = script.Parent
local block = workspace[script.Parent.Adornee.Name]
scaleHandle.MouseDrag:Connect(function(face, distance)
	if face == Enum.NormalId.Left or face == Enum.NormalId.Right then
		
		block.Size += Vector3.new(distance, 0, 0) 
		block.Position += Vector3.new(distance / 2, 0, 0)
	end
	if face == Enum.NormalId.Top or face == Enum.NormalId.Bottom then
		block.Size += Vector3.new(0, distance, 0) 
		block.Position += Vector3.new(0, distance / 2, 0)
	end
	if face == Enum.NormalId.Front or Enum.NormalId.Back then
		block.Size += Vector3.new(0, 0, distance) 
		block.Position += Vector3.new(0, 0, distance / 2)
	end
end)

I’ll send the full way I did it soon!

Hello? Are you still there? Been waiting a while

Sorry, I never made it back to my computer. Anyways, I found out that the resize tool was the only unfinished one, it’s really buggy and the right and bottom handle scales the opposite way, aswell as the part scaling on both sides.

So like, what should I do next then?

Okay, so this is very urgent, and I need a solution or another comment for this post cause I don’t know what to do next.