So I created a tool that places a block wherever "mouse.hit.p" is. However, it doesn't place the block like how it would be in minecraft. The part is literally placed in the mouse's position and part of the block is not showing. How can I make it so the whole block is showing when I place it?
CB.OnServerEvent:connect(function(t,cb,offset,target)
if target and target:IsA("BasePart") then
local newoffset = Vector3.new(math.floor(offset.X),math.floor(offset.Y),math.floor(offset.Z))
local part = Instance.new("Part")
if targetSurface == Enum.NormalId.Top then
part.Position = newoffset + Vector3.new(0,1,0) -- This part only works when I place it ON TOP of something. I also used mouse.TargetSurface, but that won't work either because some blocks are rotated or upside down.
else
part.Position = newoffset + Vector3.new(0,0,0)
end
part.Anchored = true
part.Size = Vector3.new(2,2,2)
part.TopSurface = "Smooth"
part.BottomSurface = "Smooth"
part.BrickColor = BrickColor.new("Medium stone grey")
part.Parent = workspace
wait(.01)
end
end)
