Skip to content

Commit

Permalink
fixed craft for loop issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Rencikas committed Nov 1, 2022
1 parent 0b1483c commit 690b26e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions server/craft.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ end)
RegisterNetEvent('ren-business:craft:item', function(data)
local pData = QBCore.Functions.GetPlayer(source)

if HasCraftItems(source, data.craft) then
if HasCraftItems(source, data.craft) then

for k,v in pairs(data.craft) do
pData.Functions.RemoveItem(k, v)
pData.Functions.AddItem(data.item, 1)

pData.Functions.RemoveItem(k, v)
TriggerClientEvent('inventory:client:ItemBox', source, QBCore.Shared.Items[k], "remove", v)
TriggerClientEvent('inventory:client:ItemBox', source, QBCore.Shared.Items[data.item], "add", 1)
end

pData.Functions.AddItem(data.item, 1)
TriggerClientEvent('inventory:client:ItemBox', source, QBCore.Shared.Items[data.item], "add", 1)

end
end)
Expand Down

0 comments on commit 690b26e

Please sign in to comment.