-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.lua
More file actions
21 lines (19 loc) · 929 Bytes
/
server.lua
File metadata and controls
21 lines (19 loc) · 929 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
CreateThread(function()
for k, v in pairs(Configusableitems.items) do
ESX.RegisterUsableItem(k, function(source)
local xPlayer = ESX.GetPlayerFromId(source)
xPlayer.removeInventoryItem(k, 1)
for l,i in pairs(v.Art) do
TriggerClientEvent('esx_status:add', source, i, v.menge)
if i == "hunger" then
TriggerClientEvent('esx_basicneeds:onEat', source, v.prop_name)
elseif i == "thirst" then
TriggerClientEvent('esx_basicneeds:onDrink', source, v.prop_name)
elseif i == "drunk" then
TriggerClientEvent('esx_optionalneeds:onDrink', source, v.prop_name)
end
end
xPlayer.showNotification(v.notification)
end)
end
end)