Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does my admin script not work?

Asked by
IcyEvil 260 Moderation Voter
9 years ago

here is the error I get.

Workspace.Script:3: bad argument #1 to 'pairs' (table expected, got nil)

And here is the script.

admins = {"amegaman"}

for i,v in pairs(isAdmin) do
    for x,c in pairs(admins) do
        if c and v == true then
            return true
        elseif c.Chatted and true then
            c.Chatted = true return
        end
    end
end

function message()
    if msg:sub(1,4) == "msg " then
        vic = msg:sub(1,9)
        m = Instance.new("Message")
        m.Parent = game.Workspace
        m.Text = (vic.Name.." "..Chatted)
    end
end

Answer this question