Hello ! i was bored so i made a script to lets enter players who are in the Whitelist but not the others
I prefere make a whitelist of some players than a banlist of every others roblox players.
I made this script because i made a public game but i just want to lets some players enter and no more.
Here is the script
Whitelist= "Mimibienv", "zawoitch", "laserrole", "catlooping89", "Feabrey", "Prithvi111", "HyperNovaWolf"
game.Players.PlayerAdded:Connect(function(plr)
if plr.Name == Whitelist then
print("Access Autorised for "..plr.Name)
else
plr:kick("4CC3SS D3N13D F0R "..plr.Name..". PL34S3 C0M3 B4CK L4T3R")
end
end)
ps: i write fast with a lot of fails in my words so… don’t juge meh
On this bit there is not a problem with it but I noticed you had the = right next to the Whitelist. I normally just space it out to make it look better and neater. Good job on it by the way.
Try this, using Pairs can help with these kind of things.
local Whitelist = {"Mimibienv", "zawoitch", "laserrole", "catlooping89", "Feabrey", "Prithvi111", "HyperNovaWolf"}
game.Players.PlayerAdded:Connect(function(Player)
for i,v in pairs(Whitelist) do
if Player.Name == v then
print("Access Autorised for "..Player.Name)
else
Player:kick("4CC3SS D3N13D F0R "..Player.Name..". PL34S3 C0M3 B4CK L4T3R")
end
end
end)
local Whitelist = {
["Mimibienv"] = true,
}
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(Player)
if Whitelist[Player.Name] then
warn'Whitelisted'
else
Player:Kick("You're not whitelisted")
end
end)