Hi, I made a local admin script for one of my games and I'm trying to add a table for names who can be admin but it's giving me the error. Heres the 2 parts doing it but I'm not sure how to fix it.
local settings = {
whitelist = {"PLAYER1", "PLAYER2"},
prefix = ";"
}
local plrs = game:GetService("Players")
local plr = plrs.LocalPlayer
local whitelist = plrs[settings.whitelist]
local prefix = settings.prefix
You can do to get the players like this:
local settings = { whitelist = {"PLAYER1", "PLAYER2"}, prefix = ";" } local plrs = game:GetService("Players") local plr = plrs.LocalPlayer for key, value in pairs(settings.whitelist) do for _, Player in pairs(plrs:GetChildren()) do if Player.Name == value then --You can write what you want to do to the player here. --Here, write "Player" for the player end end end local prefix = settings.prefix