And it’s super poorly optimized to boot. Why tf does everyone feel the need to do a wait of 0 instead of dynamically changing the wait as needed. There is no reason to be checking distance every frame before your close enough to drawtext/markers.
It is based on the esx_gym but it has nothing to do with it, since it has changed many things like the server.lua. It is totally changed. And the client is super different, bro, before saying anything, check the code because it is almost nothing alike. And it doesn’t consume as much
No I mean you can dynamically change the wait by using local sleep = 500 and Citizen.Wait(sleep).
You could easily set it to 500 when checking distance, and when the player is close set it to like 4 via sleep = 4 so it’s not as heavy. You don’t need to check distance every frame.
Markers don’t start blinking till a wait of like 5 or 6. And again…like I’ve said for the THIRD time now. YOU DON’T NEED TO CHECK DISTANCE EVERY FRAME!!! That just makes the resource unnecessarily heavy for no reason. You should be checking distance every 500 or so ms THEN swap to a lower ms wait to draw the marker.
Maybe a video will help you understand since you don’t want to listen…
In the video you posted, your resource is running at 0.04ms when NOT drawing markers, and moves to 0.05ms when drawing them. But yet in mine, it’s 0.01ms when NOT drawing markers, and 0.04ms when drawing them. And again, the markers AREN’T blinking.
Just by removing your Citizen.Wait(0) from the thread, adding Citizen.Wait(sleep) at the bottom and doing the following makes it not run so heavy for no reason:
The whole point of adding another variable named sleep is to dynamically change the wait of the thread AS NEEDED for optimization. While this may not be a huge deal in just one resource, having a ton of them that are poorly optimized will heavily impact client performance which DIRECTLY impacts your frames. People on poo poo pc’s will suffer more playing on a server with badly optimized resources. I’m only trying to help you learn man. You should listen to people when they give you tips, especially when they even explain why you should be doing something differently.
There is part of the esx_gym code, but not only that, the question is not that, but that idea or project was carried out by esx_gym. If instead of doing a gym you make a table tennis table it would not be the same, but the specific idea of a gym is esx_gym