Hello! I was wondering how I would be able to aim at a block, click, and a new part would be made directly on top of it. Any help?
plr = game.Players.LocalPlayer
plrMouse = plr:GetMouse()
Tool = script.Parent
Tool.Equipped:connect(function()
Tool.Activated:connect(function()
local point = plrMouse.Hit.p
local newBrick = Instance.new("Part", workspace)
newBrick.Position = point
for i = 1, 1000, -1 do
newBrick.Name = "Part"..i
if plrMouse.Target == newBrick.Name then
newBrick.Name.Position = newBrick.Position + Vector3.new(0,1,0)
end
end
end)
end)
