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

What happens in "This Mouse is no longer active"? - ANSWER PLEASE

Asked by
Tesouro 407 Moderation Voter
9 years ago

So, I made a gun (a Tool) that shoots when Activated, and the bullet Velocity is set by the Handle Position and the mouse Hit.p. In solo it works fine, but when I tried running in a server, an error said that the mouse, obtained in the Equipped event, is no longer active and it disconnected the event. Theres my script resumed:

script.Parent.Equipped:connect(function(mouse)
    handle = script.Parent.Handle
    script.Parent.Activated:connect(function()
        if script.Parent.Enabled == true and mouse then
            -- bullet creation and other stuff
            bullet.Velocity = (handle.Position - mouse.Hit.p).unit * -500
            -- more irrelevant stuff
        end
    end)
end)

In the line 6, the output says "This Mouse is no longer active", what happened and how do I fix it?

Observation: the Equipped wiki page has some notes, maybe there is some relation.

1 answer

Log in to vote
0
Answered by
1r_on 0
3 years ago

You cannot get Mouse Hit position through a normal script, You have to do it through a local Script and then use a remote event for it (if ur using Filtering enabled)

Ad

Answer this question