So I have a localscript invoking a remote function, the script should return a table but instead get the error "keys must be strings" i'v never seen this type of error before. Both the localscript and script require the table for it to work.
Inside the localscript: (ERROR HERE)
local Settings = Cheats.GetSettings:InvokeServer()
Inside the script:
local Settings = { ["Admins"] = { [74629147] = true, }, ["USER ID"] = true, ["USER NAME"] = true, ["FOG"] = true, ["GOD MODE"] = true, ["MAX HEALTH"] = 100, ["FORCEFIELD"] = true, } GetSettings.OnServerInvoke = function(Plr) return Settings end
Anyone know a solution?
Ok lesson learned, you can't return a table if that table has table in it.
local Settings = { ["Admins"] = { -- Big no no. [74629147] = true, } }
If it says keys must be strings strings are usually ' '. So try this.
local Settings = { ['Admins'] = { [74629147] = true, }, ['USER ID'] = true, ['USER NAME'] = true, ['FOG'] = true, ['GOD MODE'] = true, ['MAX HEALTH'] = 100, ['FORCEFIELD'] = true, } GetSettings.OnServerInvoke = function(Plr) return Settings end