You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.
when I have a treasure chest and key, I can open the chest but the key and chest will not be removed from inventory. this allows the chest to be opened over and over again
The text was updated successfully, but these errors were encountered:
openedTreasureChest = function()
if math.random(1,15) == 10 then
TriggerServerEvent('fishing:server:removeFishingKey')
QBCore.Functions.Notify("The corroded key has snapped", "error", 7500)
end
TriggerServerEvent('fishing:server:openedTreasureChest')
TriggerEvent("inventory:client:ItemBox", QBCore.Shared.Items["fishinglootbig"], "remove", 1)
QBCore.Functions.Notify("Treasure chest opened! Be sure to collect all of your loot!!", "success", 7500)
local ShopItems = {}
ShopItems.label = "Treasure Chest"
ShopItems.items = Config.largeLootboxRewards
ShopItems.slots = #Config.largeLootboxRewards
TriggerServerEvent("inventory:server:OpenInventory", "shop", "Vendingshop_", ShopItems)
end
Then add these in your server file
RegisterNetEvent('fishing:server:openedTreasureChest', function()
local src = source
local Player = QBCore.Functions.GetPlayer(source)
Player.Functions.RemoveItem('fishinglootbig', 1)
end)
RegisterNetEvent('fishing:server:removeFishingKey', function()
local src = source
local Player = QBCore.Functions.GetPlayer(source)
Player.Functions.RemoveItem('fishingkey', 1)
end)
Hope this helps
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
when I have a treasure chest and key, I can open the chest but the key and chest will not be removed from inventory. this allows the chest to be opened over and over again
The text was updated successfully, but these errors were encountered: