Jump to content

Events


GhostXoP

Recommended Posts

Posted

When i add an event handler to an event, does this release the last eventhandler and replace it with a new one? or is the new and the old event handler called?

Posted

You can attach as many event handlers as you want.

E.g:

function test ( ) 
end 
addEventHandler ( "onPlayerJoin", root, test ) 
addEventHandler ( "onPlayerQuit", root, test ) 
addEventHandler ( "onPlayerLogin", root, test ) 

Posted

You mean this?

function test ( ) 
end 
addEventHandler ( "onPlayerJoin", "onPlayerQuit", root, test ) 

Then no.

I guess you can make a custom function to add event handlers.

Posted
You mean this?
function test ( ) 
end 
  
function test2 ( ) 
end 
addEventHandler ( "onPlayerJoin", root, test ) 
addEventHandler ( "onPlayerJoin", root, test2 ) 

Is what i mean. Would the same event call both functions? Or would test2 replace test

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.
×
×
  • Create New...