Cheers Loque, that might be what I am running into re: createobject.
You are thinking that using netids might improve efficiency because the entity iterator method is too intensive?
It has crossed my mind, but I would imagine that its only when an object changes on the host/or client that net traffic is being generated, but maybe decor is more expensive. Sixsens server is very cool RP, first time I visited an RP server , and it has a ton of mods running as well, and I saw a lot of errors from other scripts in the console. I’m not sure if that has something to do with the lag as well, which is why playing with more players on a more vanilla server might be a better test,or maybe not. Saying that, the host is still very important, and if they disconnect it’s not a show stopper, but certain NPCs may stop doing their assigned tasks etc… until the next mission. I put in some loops for all clients to run every 10 seconds to workaround this, but enough is enough… I thought, and also that did not seem to work very well.
I should time the entity iterator, part of my optimization after sixsens feedback was to remove 4 loops into 1 loop… it appears to be moe than quick enough when I have my 2 clients at home (my old laptop as well as host), my main game state loop is calling it once every second (I should probably shorten this), I do not experience any noticeable hitches beyond what I get with vanilla Fivem (even when I had the 3 redundant loops
There are other loops too that happen as well though, that I can also probably remove a couple that are not need and definitely other tidy up.
I did notice that the code that showa a message in the middle of the screen when securing an objective no longer show via triggerevent, so I use chat message. I’m not sure if this is due to a bottle neck, or just a silly error somewhere I am not seeing, since I have the same code running for buying at the safe house and it works fine.
One thing I am not doing as well is SetModelAsNoLongerNeeded in my code.