I'm making something that adds a player to the end of the admins table, and this is meant to check how many admins there are, however, it doesn't work. How would I check how many admins there are.
local adminval = #admins adminval = tonumber(adminval) -- error here?
Error: attempt to get length of global 'admins' (a userdata value)
Using # at a table will return the amount of items in the table as a number. You need not convert it to a number because it already is one - the error is on an invalid table or table that doesn't exist.
So, you will have to create the table beforehand in case no admins are in the server but you want to see how many there are:
admins = {} --Creates a blank, ready-to-use table --Script adding players to the admins table, although you can just put them in the table and not pointlessly search for them to add them print(#admins)