So I have a 'thing' that needz to be positioned where the mouse points towards so I got this script:
local p = game.Players.LocalPlayer local m = p:GetMouse() m.Button1Down:connect(function() while m.Button1Down do if m.Target ~= nil then if m.Target.Parent ~= nil then if m.Target.Parent.Name == "Move" then m.Target.Position = m.hit.p end end end m.Move:wait() end end)
and it works just fine the onoy problem here is: The loop is not going to stop!
Use a variable instead of checking m.Button1Down.
local mouseDown=false m.Button1Down:connect(function() mouseDown=true while mouseDown do if m.Target ~= nil then if m.Target.Parent ~= nil then if m.Target.Parent.Name == "Move" then m.Target.Position = m.hit.p end end end m.Move:wait() end end) m.Button1Up:connect(function() mouseDown=false end)