[Release] ESX - Gym with Skills V1.2

👋Hello everyone, I present my new script

🗣This is my Gym Script based in esx_gym!


📜Notes:

  • The sale of this script is not allowed
  • You can use and modify it freely
  • Script not supported
  • The Original Script is ESX_GYM BY p4nda_gamingv2 but this is optimized and so much different than the original

📌Requeriments📌


💻Link Video Demostration --> YouTube

👇Download👇

📥GitHub📥

UPLOADED NEW OPTIMIZED VERSION

14 Likes

Que fresco señor Gymnasium

1 Like

jajajaja thank you my pana

1 Like

Some pictures would be welcome.

1 Like

You have a video in the description

you add some triggers on esx_gym, that is not YOUR script…

3 Likes

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.

2 Likes

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

You can change it if you want, you are free. I’m starting in development, so sorry for fails in the scripts

If necessary, because if not, the markers will be disappearing and appearing all the time since it is a loop, with that we get them to not disappear

no es tu script, tomaste el esx gym y lo modificaste, deberias darle creditos al creador…

1 Like

Ok, pero esta muy cambiado que se sepa, o me vas a decir que esta igual? (de buenas)

1 Like

Gracias por decirlo educadamente

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.

1 Like

Yes you need, because if not the markers will be blinking every half second.
And I don’t understand why create another variable

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.

1 Like

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:

Citizen.CreateThread(function()
	while true do
		local sleep = 500
		local plyCoords = GetEntityCoords(GetPlayerPed(-1), false)
			if GetDistanceBetweenCoords(-1202.09, -1567.54, 4.61, plyCoords.x, plyCoords.y, plyCoords.z) < 20 then
				sleep = 4
				DrawMarker(3, -1202.9837, -1565.1718, 4.6115, 0, 0, 0, 0, 0, 0, 0.301, 0.301, 0.3001, 0, 255, 50, 200, 0, 0, 0, 1)
				DrawMarker(3, -1203.3242, -1570.6184, 4.6115, 0, 0, 0, 0, 0, 0, 0.301, 0.301, 0.3001, 0, 255, 50, 200, 0, 0, 0, 1)
				DrawMarker(3, -1204.7958, -1560.1906, 4.6115, 0, 0, 0, 0, 0, 0, 0.301, 0.301, 0.3001, 0, 255, 50, 200, 0, 0, 0, 1)
				DrawMarker(3, -1206.1055, -1565.1589, 4.6115, 0, 0, 0, 0, 0, 0, 0.301, 0.301, 0.3001, 0, 255, 50, 200, 0, 0, 0, 1)
				DrawMarker(3, -1195.6551, -1577.7689, 4.6115, 0, 0, 0, 0, 0, 0, 0.301, 0.301, 0.3001, 0, 153, 255, 255, 0, 0, 0, 1)
				DrawMarker(3, -1200.1284, -1570.9903, 4.6115, 0, 0, 0, 0, 0, 0, 0.301, 0.301, 0.3001, 0, 255, 50, 200, 0, 0, 0, 1)
			end

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.

3 Likes

Ah OK, I understand you now. Sorry, I’m new in this, so sorry bro. Thank you :heart:

Not a problem!! Just trying to help you out homie!

3 Likes

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

1 Like