How would I make this work?

I don’t get why I get this problem.
This is my code:
function GM:PlayerAccessAdd(pl, access)
for int, acc in ipairs(playerAccess) do
if pl:SteamID() == acc[1] then
local oldAccess = string.format("%s %s", tostring(acc[2]), tostring(access))
table.remove(playerAccess, int)
table.insert(playerAccess, {pl:SteamID(), tostring(oldAccess)})
Output: 0 nil
While it should be 0 and something that was in the access string. Like a letter, g

Add prints to make sure stuff is what you think it is. You’re probably going to have to debug this yourself.

Oh… Apparently lua_run didn’t work so well from the clients console.

The function works perfectly :slight_smile: