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

Help finding a problem?

Asked by 10 years ago
local banned = {"Epicpan", "LuckTron"}
Player = game.Players.LocalPlayer
while wait(0.5) do
    if Player.Name == banned then
        Player:Kick()
    end
end

Works until I tryed multi-people banning.

1 answer

Log in to vote
2
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
10 years ago

Here's your script fixed up.

--reg script
Banned = {"Epicpan", "LuckTron"}
game.Players.PlayerAdded:connect(function(p)
    for i = 1, #Banned do
        if p.Name == Banned[i] then
            p:Kick()
        end
    end
end)


-Thank me by accepting this answer/bumping up my reputation!

0
Thanks for fixing it! :D Mind telling me what I did wrong? LuckTron 15 — 10y
0
Of course. You forgot to put air-quotes and you put () after name (which tells roblox that it's a suspected method). Mind accepting the answer? Shawnyg 4330 — 10y
0
I did great help! Tested and it worked! Now just got to get is so I have a list of ban people. Any idea about how to do that? (This is my first shot a scripting) LuckTron 15 — 10y
0
I previously added a link to a wiki post. Check it out. Shawnyg 4330 — 10y
View all comments (8 more)
0
Oh gosh you did, you know me too well. xD But thanks for the help! :D LuckTron 15 — 10y
0
Lol. No problem. Shawnyg 4330 — 10y
0
:l I managed to mess it up again with the multi-people thing. xD Want to help me out one more time? LuckTron 15 — 10y
0
Sure. Make a new post Shawnyg 4330 — 10y
0
I just updated this one, Don't want to spam the forums ya know. LuckTron 15 — 10y
0
Done Shawnyg 4330 — 10y
0
Yet, once again. Thanks! ^_^ LuckTron 15 — 10y
0
Np. Shawnyg 4330 — 10y
Ad

Answer this question