Hey guys any ideas why not working? (client-side only)
cl_personalstash.lua:
local check = false
RegisterNetEvent('qb-mechanicjob:personalstash', function()
if onDuty then
TriggerServerEvent("inventory:server:OpenInventory", "stash", "personalstash_"..QBCore.Functions.GetPlayerData().citizenid)
TriggerEvent("inventory:client:SetCurrentStash", "personalstash_"..QBCore.Functions.GetPlayerData().citizenid)
end
end)
local function Controls(variable)
CreateThread(function()
check = true
while check do
if IsControlJustPressed(0, 38) then
exports['qb-core']:KeyPressed(38)
if variable == "personalstash" then
TriggerEvent('qb-mechanicjob:personalstash')
end
end
Wait(1)
end
end)
end
CreateThread(function()
local stashPoly = {}
for k, v in pairs(Config.Locations["personalstash"]) do
stashPoly[#stashPoly+1] = BoxZone:Create(vector3(vector3(v.x, v.y, v.z)), 1, 1, {
name="personalstash"..k,
debugPoly = false,
heading = -20,
minZ = v.z - 2,
maxZ = v.z + 2,
})
end
local stashCombo = ComboZone:Create(stashPoly, {name = "stashCombo", debugPoly = false})
stashCombo:onPlayerInOut(function(isPointInside)
if isPointInside and PlayerJob.name =="mechanic" then
if onDuty then
exports['qb-core']:DrawText("[E] Öffne Personalschrank",'left')
Controls("personalstash")
end
else
check = false
exports['qb-core']:HideText()
end
end)
end)
Config.lua:
["personalstash"] = vector3(153.9, -3011.36, 7.04),