Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

"This mouse is no longer active" how do I fix this?

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?

2 comments

0

Could you please add more to this code? Just this doesn't tell us much.

0

From what I've been able to gather about this problem is to just put an error handler around it, basically a pcall.

1 answer

✓ Accepted answer

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)

1 comment

0

Thanks, the error hasn't been showing up anymore.

This discussion is preserved as it was. New answers, comments, and votes are closed.