Security HUD
System Watchdog
×
Threads Scanned
-- / --
SYS. LOAD --%
AI SHIELD ACTIVE
DMCA Policy
×

📋 DMCA Compliance

This platform and community fully complies with the Digital Millennium Copyright Act (DMCA) and international copyright laws. We take all copyright protection seriously.

🛡️ Copyright Protection

If you believe a posted item belongs to you or violates your copyright, you may file a DMCA takedown request through our official channels. Upon receiving a valid claim, the infringing content will be removed within 24 hours.

What's new
×
Fiveguard

Script [ESX] Combine Items - 2022

Respown

Gold Elite
Joined
Aug 3, 2021
Messages
192
Solutions
1
Reaction score
98,708
Points
306
Location
root
Good day, I have finished something small here.
If your inventory script does not support this function, this is the perfect script!



You have in this script the possibility to combine two items to one or three to one. I named the variables and functions after the needed information, as well as what they do.



To note is in the “client.lua” in line 19. Here you have to replace your progressbar, if you don’t have this ( ).

Explanation of how the script works:
If you look into the server.lua you will find in line 4 to 7 this code:
Code:
ESX.RegisterUsableItem('paperweed', function(source)
    local xPlayer = ESX.GetPlayerFromId(source)
    combineTwoItems(source, xPlayer, 'paperweed', 'marijuana', 1, 'joint', 1, "Joint drehen", 10000, "mp_arresting", "a_uncuff")
end)

This makes the “paperweed” usable, when used it turns 1x “marijuana” and 1x “paperweed” into a “joint”.

The player can use this item everywhere, i.e. he can use the “paperweed” everywhere on the map, if he has the other items in his inventory. As soon as he uses the item, the progressbar is triggered, and he does an emote, which looks similar to Joint turn.

So if you want to make more item combinable, I can write you the following template:

Code:
ESX.RegisterUsableItem('useITEM', function(source)
    local xPlayer = ESX.GetPlayerFromId(source)
    combineTwoItems(source, xPlayer, 'useITEM', 'needItem', numberOfTheyNeed, 'resultItem', numberOfTheyGet, "TEXT", durationOfCombine, "EmoteCategory", "EmoteName")
end)
 

Safeones

Member
Joined
Jan 6, 2022
Messages
3
Reaction score
0
Points
146
Location
Somewhere
Hello, how would I be able to use this for a fishing rod? Im trying to make that useable but not combine it
 
Top