Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow a new target option to configure whether all items should be required #60

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 31 additions & 2 deletions client/main.lua
Original file line number Diff line number Diff line change
@@ -148,8 +148,37 @@ local function enableTargeting()
hide = true
end

if option.items and not PlayerHasItems(option.items) then
hide = true
if option.items then
local _type = type(option.items)

if option.itemsAny and _type ~= "string" then
if _type == "table" then
local _h = true
local _tableType = table.type(option.items)

if _tableType == "hash" then
for name, amount in pairs(option.items) do
if PlayerHasItems({[name] = amount}) then
_h = false
break
end
end
elseif _tableType == "array" then
for i = 1, #option.items do
if PlayerHasItems(option.items[i]) then
_h = false
break
end
end
end

hide = _h
end
else
if not PlayerHasItems(option.items) then
hide = true
end
end
end

local bone = option.bones