Skip to content

Commit

Permalink
fix(jobsystem): input nil value
Browse files Browse the repository at this point in the history
  • Loading branch information
polisek committed Feb 26, 2024
1 parent 140326b commit a08879b
Showing 1 changed file with 29 additions and 28 deletions.
57 changes: 29 additions & 28 deletions client/creation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -267,40 +267,41 @@ local function openCraftingTable(id)
{ type = 'select', label = "Main item", description = "This is the item you want to crafting.",required = true, options = showedItems, clearable = true },
{ type = 'multi-select', label = "Ingedience", description = "Required",required = true, options = showedItems, clearable = true },
})
if tostring(input[1]) ~= "" then
local searched_value = tostring(input[1])
FilterData.useFilter = true
for word in searched_value:gmatch("[^,%s]+") do
table.insert(FilterData.filteredData, word)
if input then
if tostring(input[1]) ~= "" then
local searched_value = tostring(input[1])
FilterData.useFilter = true
for word in searched_value:gmatch("[^,%s]+") do
table.insert(FilterData.filteredData, word)
end
goto BackToFilter
end
goto BackToFilter
end
if input[1] == "" then
if input then
if input[1] == "" then


local defineIngedience = {}
for _, selectedIngedience in pairs(input[3]) do
table.insert(defineIngedience, {
itemName = selectedIngedience,
itemCount = 1,
})
end

local defineIngedience = {}
for _, selectedIngedience in pairs(input[3]) do
table.insert(defineIngedience, {
itemName = selectedIngedience,
local newTable = {
itemName = input[2],
itemCount = 1,
ingedience = defineIngedience
}
table.insert(selectedJob.craftings[id].items, newTable)
TriggerSecureEvent("pls_jobsystem:server:saveJob", selectedJob)
lib.notify({
title="New recipe created",
description="Congrats! New recepie has been created.",
type="success"
})
openCraftingTable(cached.crafting_table_id)
end

local newTable = {
itemName = input[2],
itemCount = 1,
ingedience = defineIngedience
}
table.insert(selectedJob.craftings[id].items, newTable)
TriggerSecureEvent("pls_jobsystem:server:saveJob", selectedJob)
lib.notify({
title="New recipe created",
description="Congrats! New recepie has been created.",
type="success"
})
openCraftingTable(cached.crafting_table_id)
end
end
end,
})

Expand Down

0 comments on commit a08879b

Please sign in to comment.