Im making a loop where it changes a parts position constantly until you click. However the click function happpens without me even clicking. Dont know why it does that.

Code looks something like this

Completed = false

while true do
	(Lots of other code here)
	while Completed == false do
		wait(.05)
		Mouse.Button1Down:connect(function()
			print("Mouse was clicked")
		end)
	end
end

Summary: While loop runs function even thought the mouse wasn't clicked. Any fixes?

1 comment

0

try moving line 5 and 6 on line 10.