I am trying to create a script that retrieves the values in the workes table, but for some reason it returns nil
. What am I doing wrong or what is the correct way to achieve this?
ModuleScript with table:
local ShopConfig = {}
local ServerStorage = game:GetService("ServerStorage")
ShopConfig.Shops = {
["Shop1"] = {
["Name"] = "GunStore",
["Owner"] = 21907526,
["Logo"] = "http://www.roblox.com/asset/?id=8672671145",
["Workers"] = {406195491,288793314},
["Tools"] = {ServerStorage["DLA-13"],ServerStorage.TestTool}
}
}
return ShopConfig
local Character = script.Parent
local Players = game:GetService("Players")
local Player = Players:GetPlayerFromCharacter(Character)
local ShopSettings = require(script.ShopConfig)
local RP = game:GetService("ReplicatedStorage")
local LoadGUI = RP:WaitForChild("LoadShopGUI")
function LoadGUI()
repeat task.wait(0.2) until ShopSettings.Shops ~= nil
for i, Shop in pairs(ShopSettings.Shops) do
local Workers = table.find(Shop,"Workers")
print(Workers)
end
end
LoadGUI()