Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

determining mouse click during loop?

Asked by 7 years ago
Edited 7 years ago

so, i have the following code.

local move=true
local mouse=game.Players.LocalPlayer:GetMouse()
local part=workspace.TEST
while move do
    part.CFrame=mouse.hit
    mouse.Button1Down:connect(function()
        print("hello")
    end)
    wait(math.huge) --jk
end

it is supposed to determine when the mouse is clicked, however when i run the code this is the output:

As you can see, it is empty and the hello isnt printing. If anyone could tell me how i can determine a click while the loop is running, it would be much appreciated.

Answer this question