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
3 years ago
Edited 3 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.

1repeat
2    task.wait()
3    mouseobjectc.Position = mouse.Hit.Position
4until 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 3 years ago
Edited 3 years ago
01mouse.TargetFilter=mouseobjectc
02local tab={mouse.Move:Connect(function()
03    mouseobjectc.Position = mouse.Hit.Position
04end)}
05tab[2]=mouse.Button1Down:Connect(function()
06    for _,v in ipairs(tab)do
07        v:Disconnect()
08    end
09end)
10--mouse.Button1Down:Wait()
0
i didnt even think of that thanks! NEILASc 84 — 3y
Ad

Answer this question