[RELEASE] [FREE] [ESX] Charlies Mining Script

Hi All,

This is my first script - very green at scripting.

FEATURES:

ORES
Chance varied to drop ores - 5 currently.
Define how many ores can drop.
Chance to drop no ores.

GEMS
Chance to drop Gems/Jewels.
Define how many Gems/Jewels can drop.

PICKAXE
Define Break Chance for Pickaxe.
Choose if pickaxe attached during mining animation.

When you mine a spot, you get 4 mine attempts before it disappears and another spawns somewhere else. There are 20 spots on the map at one time. In the config, you place the locations that are rolled for each spot.

0.014

Downsides:
You cannot have less than 20 spots. I have yet to figure out how to pass this successfully. Once this is solved the ms should drop from the script a tad.
The description of Percentage Blocks might be confusing in config to people. This I will try and change at some point if it garners interest.

charlies_mining.rar (6.5 KB)

3 Likes

preview?

1.15 ms wtf?

3 Likes

Bro, this is his first script. Instead of reacting like a pro why not just give him some support and respect?
One more thing its just free. You can improve it if you want.

4 Likes

If you could upload the resource to github, it would be easier to make pull requests.

1 Like

I have no idea what that means. I know i’ve downloaded a lot of scripts from there but no clue on what functionality it has apart from viewing inside the lua files before downloading.

Yeah just making a functional script was the goal. I will slowly refine it as I learn how to cut back on looping citizen threads. I think a portion of the ms is due to 20 markers on the map, but unsure how much that is causing. I think the main thing is the scripts that are looping.

Just check the distance between the player and each marker. If the distance is greater than 20m for example, you can add an else statement waiting. Example:

if(GetDistanceBetweenCoords(coords, v.Pos[i].x, v.Pos[i].y, v.Pos[i].z, false) < 10) then

      DrawMarker(Config.Type,v.Pos[i].x, v.Pos[i].y, v.Pos[i].z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.Size.x, Config.Size.y, Config.Size.z, Config.Color.r, Config.Color.g, Config.Color.b, 100, false, true, 2, false, false, false, false)

 else
      Citizen.Wait(1000)
 end
1 Like

This 1 second wait will improve things?

still no video?

1 Like

nice!

Yes, sorry so much i dont have a good day in these moment. is a nice script and free, the most important thing is start and @ItsCharlieTV just start he adventure. Thanks so much

1 Like

Yeah hopefully I can get the ms down in the next few days and it will be more usable for other people. Hopefully add a few more config variables to make it more customizable.

2 Likes

I have dropped it to 0.014 ms. This is about as good as it gets i think - at least until I learn more.

2 Likes

nice! much better performance!

yeah also a few bugs were fixed though still have to have 20 spots which sucks.

Yes, if you do so, it wont check all the information every 0 or 1 ms, it will be 1000 times greater so you improve it by 1000 times.

don’t really go above 1000ms cuz it reduces the respond time to the client and it wont affect it above 1000ms anymore.