Im trying to make a Ban script and, I need to know why this doesnt Work.
bans = {"Player1"}-- add onto
-- Don't touch any of this unless you know what you are doing.
for i,v in pairs(game.Players:GetPlayers(bans)) do
v:remove()
end
Im trying to make a Ban script and, I need to know why this doesnt Work.
bans = {"Player1"}-- add onto
-- Don't touch any of this unless you know what you are doing.
for i,v in pairs(game.Players:GetPlayers(bans)) do
v:remove()
end
This doesn't work because the player isn't even in the game yet. Use this instead: You also didn't use tables correctly.
bans = {"Player1"}
game.Players.PlayerAdded:connect(function(player)
for i,v in pairs(bans) do
if player.Name==v then
player:Kick()
end
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
Thanks, I am new to the pairs, in pairs, and ipairs, Thank You! :D
No problem. Contact me anytime if you need anymore help or advice!