Search the Community
Showing results for tags 'onclientresourcestart'.
-
It's because of the onClientResourceStart event, but i dont know why its triggering it twice. Thanks function create() triggerServerEvent ( "create_s", resourceRoot) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), create) and the server function create_s() outputChatBox("lol") end addEvent("create_s", true) addEventHandler("create_s", resourceRoot, create_s)
- 2 replies
-
- triggerserverevent
- onclientresourcestart
-
(and 2 more)
Tagged with:
-
Hello I'm creating a script that will trigger an event if a resource started. Serverside addEventHandler("onResourceStart", resourceRoot, function() local accResource = getResourceFromName("accounts") if (accResource) then outputServerLog("Initializing account resource.") startResource(accResource) -- start another res here else shutdown("Didn't find a required resource 'accounts' from the server. Shutting down...") end end ) Clientside function initStartup(resource) --outputChatBox( getResourceName( resource ) ) if (getResourceName(resource) == "accounts") then triggerEvent("accounts:initStartup", localPlayer) end end end addEventHandler("onClientResourceStart", root, initStartup) The problem is on the clientside, the 'accounts' resource isn't started. But, in server the 'accounts' resource has been started. So i cant trigger the "accounts:initStartup" event. I have no idea why, so maybe someone can help me, thanks
- 5 replies
-
- resource
- onclientresourcestart
-
(and 1 more)
Tagged with: