Update cocaine.lua

This commit is contained in:
Mustache Dom authored and GitHub committed 2023-03-26 10:42:44 -07:00
1 parent b3ae62f81c
commit a239b86172
1 file changed
+6 -3
+6 -3
View File
@@ -38,21 +38,24 @@ RegisterServerEvent('md-drugs:server:makepowder', function()
local randomchance = math.random(1,100) local randomchance = math.random(1,100)
if randomchance <= 80 then if randomchance <= 80 then
Player.Functions.RemoveItem("coca_leaf", 1) if Player.Functions.RemoveItem("coca_leaf", 1) then
Player.Functions.AddItem("coke", 1) Player.Functions.AddItem("coke", 1)
TriggerClientEvent("inventory:client:ItemBox", source, QBCore.Shared.Items['coke'], "add", 1) TriggerClientEvent("inventory:client:ItemBox", source, QBCore.Shared.Items['coke'], "add", 1)
TriggerClientEvent("inventory:client:ItemBox", source, QBCore.Shared.Items['coca_leaf'], "remove", 1) TriggerClientEvent("inventory:client:ItemBox", source, QBCore.Shared.Items['coca_leaf'], "remove", 1)
end
elseif randomchance >= 81 and randomchance <= 95 then elseif randomchance >= 81 and randomchance <= 95 then
Player.Functions.RemoveItem("coca_leaf", 1) if Player.Functions.RemoveItem("coca_leaf", 1) then
Player.Functions.AddItem("cokestagetwo", 1) Player.Functions.AddItem("cokestagetwo", 1)
TriggerClientEvent("inventory:client:ItemBox", source, QBCore.Shared.Items['cokestagetwo'], "add", 1) TriggerClientEvent("inventory:client:ItemBox", source, QBCore.Shared.Items['cokestagetwo'], "add", 1)
TriggerClientEvent("inventory:client:ItemBox", source, QBCore.Shared.Items['coca_leaf'], "remove", 1) TriggerClientEvent("inventory:client:ItemBox", source, QBCore.Shared.Items['coca_leaf'], "remove", 1)
end
else else
Player.Functions.RemoveItem("coca_leaf", 1) if Player.Functions.RemoveItem("coca_leaf", 1) then
Player.Functions.AddItem("cokestagethree", 1) Player.Functions.AddItem("cokestagethree", 1)
TriggerClientEvent("inventory:client:ItemBox", source, QBCore.Shared.Items['cokestagethree'], "add", 1) TriggerClientEvent("inventory:client:ItemBox", source, QBCore.Shared.Items['cokestagethree'], "add", 1)
TriggerClientEvent("inventory:client:ItemBox", source, QBCore.Shared.Items['coca_leaf'], "remove", 1) TriggerClientEvent("inventory:client:ItemBox", source, QBCore.Shared.Items['coca_leaf'], "remove", 1)
end end
end
end) end)