Help solving a couple issues with my resize tool?

I have two issues with a custom resize tool I would like to address in this post.

1: my tool resizes the wrong direction when rotated.

local tool = script.Parent
local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()
enabled = true
local selectionBox
local selectionLasso
local handles
local previousDistance
local originalpart
local buttonupconnection
local tempart
local increment = 0.5
local originalcf, originalsize




local AxisSizeMultipliers = {
	[Enum.NormalId.Top] = Vector3.new(0, 1, 0);
	[Enum.NormalId.Bottom] = Vector3.new(0, 1, 0);
	[Enum.NormalId.Front] = Vector3.new(0, 0, 1);
	[Enum.NormalId.Back] = Vector3.new(0, 0, 1);
	[Enum.NormalId.Left] = Vector3.new(1, 0, 0);
	[Enum.NormalId.Right] = Vector3.new(1, 0, 0);
}


local AxisPositioningMultipliers = {
	[Enum.NormalId.Top] = Vector3.new(0, 1, 0);
	[Enum.NormalId.Bottom] = Vector3.new(0, -1, 0);
	[Enum.NormalId.Front] = Vector3.new(0, 0, -1);
	[Enum.NormalId.Back] = Vector3.new(0, 0, 1);
	[Enum.NormalId.Left] = Vector3.new(-1, 0, 0);
	[Enum.NormalId.Right] = Vector3.new(1, 0, 0);
}




function onHandlesDown(normal)
	originalcf = handles.Adornee.CFrame
	originalsize = handles.Adornee.Size
	previousDistance = 0
end



function onHandlesDrag(normal, distance)
	if handles.Adornee then
		distance = distance - (distance%increment)
		handles.Adornee.Size = originalsize + AxisSizeMultipliers[normal] * distance
		handles.Adornee.CFrame = originalcf + (AxisPositioningMultipliers[normal] * distance) / 2
			
			if handles.Adornee then
				previousDistance = distance
				--send changes to server
				buttonupconnection = mouse.Button1Up:connect(function()onButton1Up(mouse,handles.Adornee)end)
	--
		end
	end
end




function onButton1Up(mouse,part)
	if part and script.Parent.Parent == plr.Character then
	local size = part.Size
	local cfr = part.CFrame
	script.Parent.PartChange:FireServer(originalpart,size,cfr)
	end
end




function onButton1Down(mouse)
	local findpart = game.ReplicatedStorage.BuildingParts:FindFirstChild(mouse.Target.Name)
	if tempart then
		tempart:Destroy()
		end
	if mouse.Target == nil or mouse.Target.Locked or not findpart then
		print("nil")
		selectionBox.Adornee = nil
		selectionLasso.Part = nil
		handles.Adornee = nil
	else
		print("not nil")
		originalpart = mouse.Target
		tempart = findpart:Clone()
		tempart.CanCollide = false
		tempart.Anchored = true
		tempart.Transparency = 0.6
		tempart.Size = originalpart.Size
		tempart.Parent = game.Workspace
		tempart.CFrame = originalpart.CFrame
		tempart.BrickColor = BrickColor.new("Lime green")
		selectionBox.Adornee = tempart
		selectionLasso.Part = tempart
		handles.Adornee = tempart
		handles.Faces = tempart.ResizeableFaces
	end
end




function onEquippedLocal(mouse)
	mouse.Button1Down:connect(function() onButton1Down(mouse) end)

	local character = script.Parent.Parent
	local player = game.Players:GetPlayerFromCharacter(character)
	
	selectionBox = Instance.new("SelectionBox")
	selectionBox.Color = BrickColor.Blue()
	selectionBox.Adornee = nil
	selectionBox.Parent = player.PlayerGui

	selectionLasso = Instance.new("SelectionPartLasso")
	selectionLasso.Name = "Model Delete Lasso"
	selectionLasso.Humanoid = character.Humanoid
	selectionLasso.Parent = game.workspace
	selectionLasso.Part = nil
	selectionLasso.Visible = true
	selectionLasso.archivable = false
	selectionLasso.Color = BrickColor.Red()

	handles = Instance.new("Handles")
	handles.Color = BrickColor.Blue()
	handles.Adornee = nil
	handles.MouseDrag:connect(onHandlesDrag)
	handles.MouseButton1Down:connect(onHandlesDown)
	handles.Parent = player.PlayerGui
end

function onUnequippedLocal()
	selectionBox:Destroy()
	selectionLasso:Destroy()
	handles:Destroy()
	if handles.Adornee then
		handles.Adornee:Destroy()
	end
	if buttonupconnection then
	buttonupconnection:Disconnect()
	end
end


tool.Equipped:connect(onEquippedLocal)
tool.Unequipped:connect(onUnequippedLocal)

the problem occurs when dragging the handles. if a part has not been rotated, resizing the part works just fine, dragging left causes the part to resize to the left,etc.
if the part has been rotated recently, resizing the part resizes in the wrong direction. dragging one direction may cause the part to resize sideways or in the opposite direction.why is this occurring?

2: remote events hit the spam limit too often.

I came upon this problem only recently, in the script above, a remote event is fired and provides key information such as part name,its cframe,size, etc. but when a player resizes a part fast enough this happens:


after waiting I checked to see if this still happened and I could only resize 3 or 4 times before this happens again, why is this happening? is what Im sending through the remote event too much?

Don’t send changes to the server on drag, send it on mouseup.

Also, if I’m reading this correctly, you are connecting a new event to button up every drag? So say you get 100 drag notifiers, now when button up happens you get 100 remote events fired?

Just have 1 top level button up handler for everything. Set some global variables like DragPart in the Drag event, when you get the notification fire the remote

ahhhhh, I see that now, I think the remote event is getting fired twice because of a recent change I made to it. but that makes sense.

so what about the resizing issue, I have a hunch it has to do with the direction but I cant put my finger on it.