So, I have a script that is meant to function when a Player is added. Once fired, it checks if that player's name equals one of the values inside of a folder inside of the script. If it matches, it then kicks the player and displays a custom message, but it doesn't function, and I can't find out why.
local WhiteList = script.Folder:GetChildren()
local Defined = script.Folder.Defined.Value
local Player = game.Players.PlayerAdded
local A = script.Folder("1").Value
local B = script.Folder("2").Value
local C = script.Folder("3").Value
local D = script.Folder("4").Value
local E = script.Folder("5").Value
game.Players.PlayerAdded:connect(function()
if Player == Defined then
game.Players(Player):Kick("Go away, you have no friends...")
print("Player Attempted to join!")
elseif Player.Name == A or B or C or D or E then
game.Players(Player):Kick("Bai!")
end
end)
For help, here is the model: http://www.roblox.com/THIS-IS-SPARTA-item?id=339927939

3 comments
For the record, that's blacklist.
idc
What ChemicalHex said.