Files
md-drugs/server/lean.lua
T

31 lines
980 B
Lua
Raw Normal View History

2023-12-07 15:45:48 -08:00
local QBCore = exports['qb-core']:GetCoreObject()
2024-05-02 18:34:49 -07:00
2023-12-07 15:45:48 -08:00
RegisterServerEvent('md-drugs:server:givelean', function()
local src = source
local chance = math.random(1,100)
local amount = math.random(1,5)
if chance <= 50 then
if AddItem(src, 'mdlean', amount) then
2024-05-02 18:34:49 -07:00
Notifys(Lang.Lean.lean, "success")
Log(GetName(src) .. ' Got ' .. amount .. ' Of Lean' , 'lean')
2023-12-07 15:45:48 -08:00
end
else
if AddItem(src, 'mdreddextro', amount) then
2024-05-02 18:34:49 -07:00
Notifys(Lang.Lean.dextro, "success")
Log(GetName(src) .. ' Got ' .. amount .. ' Of Red Dextro' , 'lean')
2023-12-07 15:45:48 -08:00
end
end
end)
QBCore.Functions.CreateUseableItem('leancup', function(source, item)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
if Itemcheck(src, 'leancup', 1) then
TriggerClientEvent('md-drugs:client:leancraft', src)
2023-12-07 15:45:48 -08:00
end
2023-12-07 16:51:51 -08:00
end)
RegisterServerEvent('md-drugs:server:finishcup', function(data)
local src = source
if not GetRecipe(source, 'lean','cups', data.item) then return end
end)