Non overlaping building system

so im making a building system but i cant make the part go on top

Could you explain more, it’s pretty vague at the moment.

local script:
script.Parent:WaitForChild(“Handle”)
local eq = false
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local parttouching = false

script.Parent.Equipped:Connect(function()
eq = true
end)

script.Parent.Unequipped:Connect(function()
eq = false
end)

mouse.Button1Down:Connect(function()
if eq == true then
script.Parent.Placed:FireServer(mouse.Hit, script.Parent:WaitForChild(“Part”).Position)
end
if script.Parent:FindFirstChild(“Part”) then
script.Parent.Part:Destroy()
end
end)

while true do
wait(0.1)
if mouse.Target == “Terrain” then
parttouching = false
else
parttouching = true
end
if eq == true then
if not script.Parent:FindFirstChild(“Part”) then
local part = Instance.new(“Part”)
part.Size = Vector3.new(2, 0.5, 1)
part.Name = “Part”
part.Anchored = true
part.CanCollide = false
part.Material = Enum.Material.Neon
part.BrickColor = BrickColor.new(“Lime green”)
–if parttouching == false then
–part.Position = Vector3.new(math.floor(mouse.Hit.X), math.floor(mouse.Hit.Y), math.floor(mouse.Hit.Z))
–else
–part.Position = Vector3.new(math.floor(mouse.Hit.X), part.Position.Y, math.floor(mouse.Hit.Z))
–end
part.Position = Vector3.new(math.floor(mouse.Hit.X), math.floor(mouse.Hit.Y), math.floor(mouse.Hit.Z))
part.Parent = script.Parent
else
script.Parent.Part.Position = Vector3.new(math.floor(mouse.Hit.X), math.floor(mouse.Hit.Y), math.floor(mouse.Hit.Z))
end
end
end

server Script:

script.Parent.Placed.OnServerEvent:Connect(function(player, mousePos,part2)
local part = script.Parent:WaitForChild(“Handle”):Clone()
part.Name = “Part”
part.Anchored = true
part.CanCollide = true
part.Position = part2
part.Size = Vector3.new(6,1.5,3)
part.Parent = game.Workspace.Placed
script.Parent:Destroy()
end)

You need to include much more details as to what you are attempting to fix.
I’m not sure anyone is able to help you out given the current information you’ve provided in your post.

sorry for the lag
but when i place the parts there overlapping not going on top of echother how can i fix that?