-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathserver.lua
More file actions
33 lines (30 loc) · 1.04 KB
/
server.lua
File metadata and controls
33 lines (30 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
local ox_inventory = exports.ox_inventory
--------- NIK Kit
local testKit = ox_inventory:registerHook('swapItems', function(payload)
local src = payload.source
local testresult = 'Negative'
if payload.toSlot ~= nil and payload.toSlot.name ~= 'nikkit' and payload.fromInventory == payload.source then
local drug = payload.toSlot.name
TriggerClientEvent('ox_inventory:closeInventory', src)
TriggerClientEvent('shark-leotools:TestKit', src)
Wait(2000)
ox_inventory:RemoveItem(src, 'nikkit', 1)
for key, value in pairs(Config.NIK) do
for k, v in ipairs(Config.NIK[key]) do
if v == drug then
testresult = key..' Positive'
break end
end
end
ox_inventory:AddItem(src, 'usednikkit', 1, {description = testresult})
return false
end
end,
{
print = true,
itemFilter = {nikkit = true}
})
---- NVGs
RegisterServerEvent('shark-leotools:giveBack', function(type)
ox_inventory:AddItem(source, type, 1)
end)