Help with local script running twice

Hello. This script keeps running twice after I move my mouse out of it. Is there anyway to fix this?

On line 54 you are creating a bind to Mouse.Move that doesn’t appear to ever be disconnected.You might accidentally create multiple, which could cause the issue you’re seeing, if not another issue.

As azqjanna said, you are creating a bind to Mouse.Move that doesn’t seem like to ever be disconnected.

You can create an event connection variable like this:

-- This is just an example, not a real script.
local eventConnection
eventConnection = instance.Event:Connect(function(p1,p2,p3...)
     -- Stuff
     eventConnection:Disconnect()
end()

Then disconnect it when you want the event to stop firing.

This is pseudocoding, which means this is just an example on how to disconnect an event.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.