im trying to make a placing system with my terrain but i already have a digging system but i dont know how to rework it
mouse = game.Players.LocalPlayer:GetMouse()
down = false
mouse.Button1Down:connect(function ()
down = true
mouse.Button1Up:connect(function ()
down = false
end)
local recordedPosition = game.Workspace.Terrain:WorldToCellPreferSolid(mouse.Hit.p)
for i = 1,2 do
if game.Workspace.Terrain:WorldToCellPreferSolid(mouse.Hit.p) ~= recordedPosition then
return
end
if down == false then
return
end
wait()
end
game.Workspace.Terrain:SetCell(recordedPosition.X,recordedPosition.Y,recordedPosition.Z,0,0,0)
end)