i tried making a minecraft like building system on a grid, it works fine, but its not what i want. it only places up and not sideways, and i dont know how to find the face a mouse is clicking on. right now i have some pretty simple code to make it so when you right click a block on the grid it appears 3 blocks above it (the block size is 3,3,3) i tried ray tracing but it was too COMPLEX for me, and it kept erroring. heres my original script:
local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()
local block = game.Lighting:FindFirstChild("block_types"):FindFirstChild("plastic")
local val
local down
function dupeblock()
if mouse.Target ~= nil and mouse.Target.Parent == workspace.grid or workspace.blocks then
local cblock = block:Clone()
cblock.Parent = workspace.blocks
cblock.Anchored = true
down = true
end
end
mouse.Button2Down:connect(dupeblock)
function placeblock()
if mouse.Target ~= nil and mouse.Target.Parent == workspace.grid or workspace.blocks then
local nblock = workspace.blocks:FindFirstChild("plastic")
nblock.CFrame = CFrame.new(mouse.Target.Position)+Vector3.new(0,3,0)
val = math.floor(math.random())
nblock.Name = nblock.Name..val
end
end
mouse.Button2Up:connect(placeblock)

2 comments
please put your code in a code block so it can be easier to read.
ok