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

Help with ban script?

Asked by 10 years ago
local banned = {"xMegs", "rymikula", "SingleSided"}

msg = game.Workspace.Message
Text = msg.Text

if banned then -- I GOT STUCK HERE it's like. If one of the banned people joins, they get kicked.
    banned:Kick()
    msg.Text = "Someone has been kicked"
    wait(5)
end

On the if statement, I got stuck, can you help?

I think is if banned == game.Workspace then

I'm not that sure.

2 answers

Log in to vote
0
Answered by
ultrabug 306 Moderation Voter
10 years ago
local banland={"ultrabug", "CheeseMan"}
game.Players.PlayerAdded:connect(function(plr) --Gets when a player joins.
    for i,v in pairs(banland) do --Cycles through the table making every value into one in a way.
        if plr.Name==v then --Checks the player's name in case it is a banned name.
            message=Instance.new("Message") --Creates a new message.
            message.Parent=plr.PlayerGui --Puts the message into the player's PlayerGui so only they can see it.
            message.Text="You are banned, gbye :)"
            wait(3)
            plr:Kick() --Kick the player.
        end
    end
end)
Ad
Log in to vote
-2
Answered by 10 years ago

Ugh, Ik how it works, I had the script itself for a ban script or kicked script but that was on my old computer so I don't have it. Later I can get it for you.

0
Ok thanks Roboy5857 20 — 10y

Answer this question