Comments (5)
Hey vanilla
If you are wanting to do an item check
then you can use
item = 'handcuffs',
If you only want to display an option when they have a specific item you can use
QBCore.Functions.HasItem
From QBCore in order to return if they player has the item or not
Please feel free to ask anything else if I misunderstood your question 😄
from qb-target.
No it's actually different, let me write it out wait a second
from qb-target.
The Player.Functions table is btw server side thus won't work
from qb-target.
canInteract = function()
local hasitem = nil
QBCore.Functions.TriggerCallback('QBCore:HasItem', function(result)
if result then
hasitem = true
else
hasitem = false
end
end)
while hasitem == nil do
Wait(1)
end
return hasitem
end,
This is the way you should do it if you want to use the config, if you're using exports or it is in the client/main.lua of qb-target, then you can use this, you do have to define PlayerData with QBCore.Functions.GetPlayerData()
canInteract = function()
for k, v in pairs(PlayerData.items)
if v.name == "lockpick" then
return true
end
end
end,
from qb-target.
thank you all
from qb-target.
Related Issues (20)
- push to talk HOT 1
- [FEATURE] Update Examples & Templates HOT 1
- AddTargetModel doesn't work on trees props - [SUPPORT] HOT 1
- [SUPPORT] HOT 1
- HELP! script error: @qb-target/client.lua:31: attempt to call a nil value (global 'Load') [SUPPORT] HOT 1
- Relocation HOT 1
- Don't use this HOT 10
- [SUGGESTION] HOT 1
- [SUPPORT] HOT 2
- can't open options HOT 2
- [Peds Duplicate]
- function AddGlobalPlayer HOT 1
- [SUPPORT]
- need a support for an issue HOT 4
- [BUG] Font Awesome Eye Not Showing HOT 29
- [BUG] Error spam latest update HOT 8
- Global Players options not working
- [BUG]Unsupported Operation HOT 2
- [BUG] Error executing native HOT 6
- Im getting an error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qb-target.