here is the local script. I've tried making the grid system with math.floor but it didn't work at all so my guess is that it is outdated.
local Mouse = game.Players.LocalPlayer:GetMouse()
local BuildMode = false
local UIS = game:GetService("UserInputService")
local Target = nil
local BuildMode2 = false
local Run = game:GetService("RunService")
local Rotating = false
local RotatingSpeed = 0.2
local de = false
local PosX = math.floor(Mouse.Hit.X/1 + 0.5) * 1
local PosY = Mouse.Hit.Y
local PosZ = math.floor(Mouse.Hit.Z/1 + 0.5) * 1
Mouse.Button1Down:Connect(function()
if BuildMode == true then
game.ReplicatedStorage.RemoteEvent:FireServer(Mouse.Hit.Position,Target.CFrame,Target.Name)
end
end)
Mouse.Move:Connect(function()
local Build = Target
if Build then
Build.Position = Vector3.new(PosX,PosY,PosZ)
end
end)
Run.RenderStepped:Connect(function()
local Build = Target
if Rotating == true and de == false then
Build.CFrame = Build.CFrame * CFrame.fromEulerAnglesXYZ(0,0.1,0)
de = true
wait(RotatingSpeed)
de = false
end
end)
UIS.InputBegan:Connect(function(k,p)
if p then return end
if k.KeyCode == Enum.KeyCode.E then
if BuildMode == false then
BuildMode = true
BuildMode2 = true
local ClientBuilding = game.ReplicatedStorage.Build1:Clone()
ClientBuilding.Parent = workspace
ClientBuilding.Transparency = 0.5
ClientBuilding.Color = Color3.fromRGB(0,255,0)
ClientBuilding.CanCollide = false
Target = ClientBuilding
Mouse.TargetFilter = ClientBuilding
print(Target.Name)
else
BuildMode = false
Target:Destroy()
Target = nil
BuildMode2 = false
end
elseif k.KeyCode == Enum.KeyCode.R then
Rotating = true
end
end)
UIS.InputEnded:Connect(function(k,p)
if k.KeyCode == Enum.KeyCode.R then
Rotating = false
end
end)

2 comments
what do you mean grid system?
like snap grid when you move your mouse the object moves 1 stud with it so it goes to the nearsest stud to the mouse position