MAB Posted August 23, 2015 Share Posted August 23, 2015 i am trying to make a setting for a resource i made and that settings changes the number of the seconds that should pass so the the timer do a function... debugscript message : Error : server triggered clientside event receiveSettings, but event is not added clientside meta : "Michael" type="script" name="" description="" /> server : local FuelTimer = get"timer" triggerClientEvent("receiveSettings", root, FuelTimer) client : local timer = 60 addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()) , function () addEvent("receiveSettings", true) end) addEventHandler("receiveSettings", root, function(arg) timer = arg end ) Link to comment
pa3ck Posted August 24, 2015 Share Posted August 24, 2015 Isn`t it because the server-side is being loaded before the client-side? Link to comment
Mr.Loki Posted August 24, 2015 Share Posted August 24, 2015 why not just client : local timer = 60 addEvent("receiveSettings", true) addEventHandler("receiveSettings", root, function(arg) timer = arg end ) and shouldnt: "images\f.png" /> "images\s.png" /> "images\e.png" /> "images\n.png" /> "images\h.png" /> "images\d.png" /> "images\c.png" /> be: "images/f.png" /> "images/s.png" /> "images/e.png" /> "images/n.png" /> "images/h.png" /> "images/d.png" /> "images/c.png" /> do those images actually load? Link to comment
pa3ck Posted August 24, 2015 Share Posted August 24, 2015 Yes, they do load. "/" "\" are the same thing in the meta.xml. I'm sure he has a reason not the put that variable inside the script. ie. he is going to compile the resource and make it public, but he wants to make it dynamic so that you can change the rate of something in the meta, which is not compiled and can be edited. Link to comment
MAB Posted August 24, 2015 Author Share Posted August 24, 2015 why not justclient : local timer = 60 addEvent("receiveSettings", true) addEventHandler("receiveSettings", root, function(arg) timer = arg end ) and shouldnt: "images\f.png" /> "images\s.png" /> "images\e.png" /> "images\n.png" /> "images\h.png" /> "images\d.png" /> "images\c.png" /> be: "images/f.png" /> "images/s.png" /> "images/e.png" /> "images/n.png" /> "images/h.png" /> "images/d.png" /> "images/c.png" /> do those images actually load? hm.. i tried what are you talking about but didn't work Link to comment
Mr.Loki Posted August 24, 2015 Share Posted August 24, 2015 in your server script, is this inside of a function? triggerClientEvent("receiveSettings", root, FuelTimer) Link to comment
Mr.Loki Posted August 25, 2015 Share Posted August 25, 2015 Isn`t it because the server-side is being loaded before the client-side? load the client before the server in the meta Link to comment
Scripting Moderators thisdp Posted August 25, 2015 Scripting Moderators Share Posted August 25, 2015 I think that the error message shows when you are downloading resource. This means your client script doesn't start when server triggers client event.From your script,I found that the value of "timer" is defined as "number" but in your meta, "timer" is a string. 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