[[ - I Have a The Script, Sometimes It's Doesn't Work, Can You help me? - ]]
local MSG = "Banned." local Banlist = {
Example = true,
}
game.Players.PlayerAdded:Connect(function(plr) if Banlist[plr.Name] then plr:Kick(MSG) end end)
You've got the right idea but it's better to loop through the table and check it's values.
local Players = game:GetService('Players') local Banlist = { 'noob123', -- username 01234 -- user id } function checkBanlist(Player) for _,v in pairs(Banlist) do -- this will check for userid if type(v) == 'number' and v == Player.UserId then return true -- this will check for usernames elseif type(v) == 'string' and string.lower(v) == string.lower(Player.Name) then return true end -- check type end -- loop return false end -- function end function onPlayerAdded(Player) if checkBanlist(Player) then Player:Kick('innabit lad, ur banned') -- you can change this to any message end -- call function end -- function end Players.PlayerAdded:Connect(onPlayerAdded)