I'm making a new command for my admin.
when i tested out this ;admin command, it didn't work. (i did it on someone who wasn't in the admins table)
admins = {"Player", "dragonmaster4111"} function findPlayer(name) for _, player in ipairs(game.Players:GetPlayers()) do if player.Name:lower() == name:lower() then return player end end end game.Players.PlayerAdded:connect(function(plr) for i,v in pairs(admins) do if v == plr.Name then plr.Chatted:connect(function(msg) if msg:sub(1,6) == ";admin" then adm = findPlayer(msg:sub(8)) if adm and adm.Character then table.insert(admins, 3, adm) end end end) end end end)
While I inspect your original code, here's what I did:
Finished Script:
local admins = {"Player", "Player 1", "dragonmaster4111", "aquathorn321"} local function findPlayer(player) for i,v in pairs(game.Players:GetPlayers()) do if v.Name == player then return v end end return false end game.Players.PlayerAdded:connect(function(player) for i,v in pairs(admins) do if v == player.Name then player.Chatted:connect(function(msg) if string.lower(string.sub(msg,1,6)) == ";admin" then local adm = findPlayer(string.sub(msg,8)) if adm then table.insert(admins,#admins + 1,adm.Name)) end end end) break end end end)