I’m sorry I will probably explain this very poorly but I’m quite lost.
The way my system works:
- GUI show a list of options from an array from a script.
Example:
local Recipes = {
["Cookie Dough"] = {
["Recipe"] = {
"Bake Cookie"
},
["ImageId"] = 6219913164
},
["Cookie Dough & Chocolate Ice Cream"] = {
["Recipe"] = {
"Bake Cookie",
"Scoop Ice Cream"
},
["ImageId"] = 6219909185
}
- The player decides which one they want from the GUI.
- The GUI shows the recipe for the chosen item, from the script.
This is how I’m currently doing that:
function Events.fetchData.OnServerInvoke(plr, ...) -- Event is fired as recipe = events.fetchData:InvokeServer("fetchItemRecipe",food)
local Data = {...}
local Request = Data[1]
if Request == "fetchItemRecipe" then
local food = Request[2] -- local food is the item from the array, e.g. Cookie Dough
local recipe = Recipes[food]
print(recipe)
return recipe
end
end
Although I am receiving nil as my response, any ideas or additional information needed?