I am sometimes getting this error 22:03:57.337 - This Mouse is no longer active It doesn't pop up a lot, but when it does it stops my gun from shooting. This is the line of code that it's coming from, the "mouse.hit.p"
local ray = Ray.new(hole.CFrame.p, (mouse.hit.p - hole.CFrame.p) * range.Value)
Is there a way to fix this, or should I use something else in place of this if so, what?
That means that the mouse is no longer defined, so you should redefine it before the code.
local mouse = game.Players.LocalPlayer:GetMouse() local ray = Ray.new(hole.CFrame.p, (mouse.hit.p - hole.CFrame.p) * range.Value)