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

Plugin repeating mouse issue?

Asked by
NEILASc 84
2 years ago
Edited 2 years ago

so im making a plugin that decorates walls. like cuts holes in walls and such. i dont need csg help or something but i have a piece of code that doesnt work and just instantly stops.

        repeat
            task.wait()
            mouseobjectc.Position = mouse.Hit.Position
        until mouse.Button1Down

and it doesnt work. yes i have attempted to use variables but just didnt work. please help?

Edit: yes i know mouse.button1down isnt the right one but thats all i could think of.

1 answer

Log in to vote
0
Answered by 2 years ago
Edited 2 years ago
mouse.TargetFilter=mouseobjectc
local tab={mouse.Move:Connect(function()
    mouseobjectc.Position = mouse.Hit.Position
end)}
tab[2]=mouse.Button1Down:Connect(function()
    for _,v in ipairs(tab)do
        v:Disconnect()
    end
end)
--mouse.Button1Down:Wait()
0
i didnt even think of that thanks! NEILASc 84 — 2y
Ad

Answer this question