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

Is this if statement possible?

Asked by 10 years ago
if admin[player.Name] then
            if msg == "shutdown server" then
                shutdown()
            end
        end

--Yes, I already made the table "admin" and I already created the function "shutdown()".

1 answer

Log in to vote
0
Answered by
Azarth 3141 Moderation Voter Community Moderator
10 years ago
local admins = {player=true, azarth = true, blackknightxx = true}

game.Players.PlayerAdded:connect(function(player)
    player.Chatted:connect(function(msg)
        if admins[player.Name:lower()] and msg:lower() == "shutdown server" then
            shutdown()
        end
    end)
end)
Ad

Answer this question