I am fairly new to scripting and I am requesting quite a bit of help, so if you don't want to help no worries, it would just mean a lot to me!
I am making a brick that when you click it, it will move with your mouse until you click again.
local player = game:GetService("Players").LocalPlayer
local Block = script.Parent
local mouse = player:GetMouse()
Block.ClickDetector.MouseClick:Connect(function(player)
while wait(Block.ClickDetector.MouseClick) do
Block.Position = mouse.Position
end
end)
but there's and error and I can't find it (Obvious) and an explanation with your answer is appreciated so I can learn off your answer!

2 comments
Doesn't work.
What's the error?