attempt to index local 'event' (a nil value)

function Mouse(event)
            print(event.type)
        end
function enterFrameToShoot(event)
            Mouse()
end
Runtime:addEventListener("mouse", Mouse)
Runtime:addEventListener("enterFrame", enterFrameToShoot)

When you’re calling the Mouse(event) function, from inside your second function, you’re not supplying it an argument for the “event” table that it expects.

Subsequently, it’s nil when the Mouse function attempts to access it in your print statement

thanks, my bad

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