rt-2

Events' "this" not working.

Recommended Posts

Hello everyone,
I previously used 'var.destroy();' successfuly, now I wanted to try the new event functions.

When I try to use the new 'this' in events it doesn't work AT ALL.

mp.events.add('anEvent', function (arg) {

     this.handler //Undefined???

     this.cancel //Undefined???

});


new mp.Events('anEvent', function (arg) {

     this.handler //Undefined???

     this.cancel //Undefined???

});


mp.events.add('anEvent', (arg) => {

     this.handler //Undefined???

     this.cancel //Undefined???

});


new mp.Events('anEvent', (arg) => {

     this.handler //Undefined???

     this.cancel //Undefined???

});


and this.handler.destroy() also returns an error.

After asking in the discord channel it seems like nobody could tell me if they ever used it or what was wrong.

Maybe it works but AS DESCRIBED in the changelog it doesn't work.


Thank you,

rt-2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.