📕->[ESX] ScrapMan-Job⚙️

Probably just change xPlayer.addMoney() to xPlayer.addInventoryItem(item, amount) in server script.
Note, i did not check the code, but i hope you get the point👍🏻

Hi @Impetro so if i get you right you want to change the payout when you sell it to the dealer nearby.
so in the sv_scrapman.lua in line 21 you can do that.
look here:

hope I got you right mate:)


nothing works at all? even when I give myself scrap as an item

Hi are you getting any error.
I had another person with the same problem but he didn’t get any errors at all.
Also what version of esx are you using?

Also as I told the script tested on esx v1 final, should not be any errors or problems with the script but let me know…

Looking at the pictures of the code your not really protecting your Server-side triggers, they can be easily exploited by modders for free money…

esx v1 as well we are using

hey people
im using the old version of the esx
everything work just fine for me
greate script arielz love ya ma bro

man idk what you want to say but its work greate…
if you mean that the cheaters can add money with the scrap trigger you have anticheats for that…

ArielZ is amazing programmer so…

Anti-cheats don’t always protect it. What i was saying is that any player with an executor can trigger both ServerEvents without any Player checks from anywhere on the map and abuse it for easy money :slight_smile: Doesn’t matter if he’s a good developer or bad, you always need to protect your triggers :smiley:

Dont know what is happening over here but let me explain for you something.
First of all i am a bit new to the coding world and also for fivem.
Still learning how to improve it by my free time so if you want to help or give me any advice you are welcome.
Second I dont use to see in codes triggers that protect of any abuse…
but in the job you cant sell scrap if you dont have… so the basic is there.
But as i said slow… i am still learning and want to share want i create so plz get it…

i dont need to feel bad because of it I expect people to help and push up…
dont say you are not like that.

Your resource is good but it’s unsafe to use because cheater can use it to get free money. Read more
here

1 Like

ok thank you, buy didnt see people that protect their resource but ok will give it a look…

Simple method, add Config.lua to fxmanifest.lua in server_scripts. Do a simple loop to get a distance between player and scrap pickup location.

RegisterNetEvent('jrp:milkGive')
AddEventHandler('jrp:milkGive', function()
	local ped = GetPlayerPed(source)
	local Player = QBCore.Functions.GetPlayer(source)
	local pos = GetEntityCoords(ped)
	for k,v in pairs(Config.Karves) do
		local kpos = vector3(v.x, v.y, v.z)
		local dist = #(pos - kpos)
		if dist < 3 then
			Player.Functions.AddItem('freshmilk', 1)
		end
	end
end)

Just a simple method to protect against Modmenu Kids. This is server-side.

ok thanks for the suggest, will sit on it later and update the script.
Thank you :slight_smile:

I got this working on es_extended 1.1 nice script man :slight_smile:

@oOvDylanvOo thank you for letting me know, soon I will update the script a bit.

script is not working

For me dont work too, esx v1 final, when im in the circle nothing appears
any help?
No errors