So, I have created a script that kicks people according to their name, however, the script is not working and is allowing the person to play.
Here is Script
function BanCheck() game:GetService('Players').PlayerAdded:Connect(function(player) local plrNAME = player.Name if plrNAME == "Rinextel" then plr:Kick("You are banned from this game") end) end BanCheck()
The way you are doing that is wrong, try out this. Also ban players by their ids because they can easily evade their ban by changing their username, but they can not change their user id. Except all of that the way that the end
s are placed is wrong.
local banlist = {1, 2, 3, 683844231} --Ids of the players which you want banned. game:GetService('Players').PlayerAdded:Connect(function(player) for i, v in pairs (banlist) do if player.UserId == v then player:Kick("You are banned from the game") end end end)
So this would not work because you have it as a function, the function is only being called once. With this script, it checks it whenever a new player joins the server. So if "Rinextel" joined the server, the script would react with: game.Players.Rinextel:Kick("You have been banned from this game!")
game.Players.PlayerAdded:Connect(function(player) game.Players.Rinextel:Kick("You have been banned from this game!") end)
Please say if there are any errors in this as i wrote this off the bat.
Check your errors in output, seems like you're missing an end.