Kazafka Posted January 30, 2020 Share Posted January 30, 2020 I don't know how Can I do it, so please, give me an example. Or maybe it is like this? triggerEvent(".res_name:onEventTriggeerred") 13 minutes ago, VaporZ said: triggerEvent(".res_name:onEventTriggeerred") It is right? Link to comment
Scripting Moderators ds1-e Posted January 30, 2020 Scripting Moderators Share Posted January 30, 2020 1 hour ago, VaporZ said: I don't know how Can I do it, so please, give me an example. Or maybe it is like this? triggerEvent(".res_name:onEventTriggeerred") It is right? If you want to do so, your event should be attached to root. resource_1 function onResourceStart() triggerEvent("eventHandler", root) end addEventHandler("onResourceStart", resourceRoot, onResourceStart) resource_2 function eventHandler() iprint("Serverside function was triggered at resource: "..getResourceName(getThisResource()).." from resource: "..getResourceName(sourceResource)) end addEvent("eventHandler", true) addEventHandler("eventHandler", root, eventHandler) Result: 1 Link to comment
Kazafka Posted January 30, 2020 Author Share Posted January 30, 2020 (edited) 6 minutes ago, majqq said: Thanks, appreciate that! (works) Edited January 30, 2020 by VaporZ 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