Drakath Posted April 16, 2014 Share Posted April 16, 2014 function greetingEvent () triggerClientEvent ( "onGreeting", getRootElement(), "Hello World!" ) end addEventHandler("onResourceStart", root, greetingEvent) function greetingHandler ( message ) outputChatBox ( "The server says: " .. message ) end addEvent( "onGreeting", true ) addEventHandler( "onGreeting", getRootElement(), greetingHandler ) Why doesn't it work with event handler 'onResourceStart"? Link to comment
Castillo Posted April 16, 2014 Share Posted April 16, 2014 Because the server side is loading faster than the client side, so the event handler doesn't yet exist. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now