i am trying to make a script for to check if a person is or is not admin
local player = script.Parent.Parent.Parent.Name local players_allowed = {"jeremqpmfpi", "gosubtojerem_qpmfpi"} print(players_allowed) wait(1) for index, player in pairs(players_allowed) do if player == players_allowed[1] then print("player is admin") end if player ~= players_allowed[1] then print("player is not admin") end end
note:
it is in the player gui i am jeremqpmfpi i tried adding brackets to the "players_allowed[1]" in the if statements also lua does tables 1 - 2 - 3 not 0 - 1 - 2 - 3
It won't really work cuz it checks the player once. Instead, you can do
local player = script.Parent.Parent.Parent.Name local players_allowed = {"jeremqpmfpi", "gosubtojerem_qpmfpi"} wait() for i, p in pairs(players_allowed) do if p.Name == players_allowed[1] then print("Admin") else print("Player") end