I need to make a placement showing outline for my single use wood block item
local in it:
local Mouse = game.Players.LocalPlayer:GetMouse()
local Positiona
script.Parent.Activated:Connect(function()
script.Parent.place:FireServer(Positiona)
end)
Mouse.Move:Connect(function()
local GridSize = 3
local X = math.floor((Mouse.Hit.X + GridSize / 2) / GridSize) * GridSize
local Y = math.ceil((Mouse.Hit.Y + GridSize / 4 ) / GridSize) * GridSize - 1.5
local Z = math.floor((Mouse.Hit.Z + GridSize / 2) / GridSize) * GridSize
Positiona = CFrame.new(X, Y, Z)
end)
server script in it
script.Parent.place.OnServerEvent:Connect(function(player, Positiona)
local shape = Instance.new("Part", workspace)
shape.Size = Vector3.new(3,3,3)
shape.Material = script.Parent.Handle.Material
shape.Anchored = true
shape.Color = script.Parent.Handle.Color
shape.CFrame = Positiona
print("BlockPlaced")
script.Parent:Destroy()
shape.PivotOffset = (CFrame.new(Positiona))
end)
(it has a remote event in it too )
I wanna make it so that it can show a outline of where the block will place ok?