Hello,
I would like to find a way to get this method which is supposed to output a table with the raw string values of each airport name to work. Currently not even the method is being triggered/fired.
I would greatly appreciate any help.
My module script:
local airport = {} airport.destinations = { Zakynthos = { Name = "Zakynthos"; IATA = "ZAK" } } airport.airlines = { Airline = { Name = "Airline"; GroupID = 1; IATA = "AA"; Destinations = { airport.destinations.Zakynthos; } } } for i, v in ipairs(airport.airlines) do function v:GetDestinations() print("method fired") local dest = {} for _, x in ipairs(v.Destinations) do table.insert(dest, x.Name) end return dest end end return airport
Script
local ReplicatedStorage = game:GetService("ReplicatedStorage") local dest = airportData.airlines.Airline:GetDestinations() for i, v in ipairs(dest) do print(v) end
Thank you!
Why do you have a GetDestinations method when you just re-iterate through them? Just iterate through airportData.airlines.Airline.Destinations
. There's no point in having a method.
You're just over thinking it, bud.
Hope you can accept this as an answer.