ok, so I'm making this private test game and I want to know how to shutdown the server if the player that enters is not on a list, Because if a bunch of people that were strangers came in, the place would not be private anymore. so heres my code:
print 'Certain Permission Script Loading...' -- alert the people that this script is loading
local servershutdown = game.Players:ClearAllChildren() -- VERY useful so I don't have to type so much...
local creatorid = game.CreatorId -- might be useful later
local ListOfPermissions = "TroytheDestroyer, DadatheDestroyer, Troy2006, Troyother" -- people who can enter without being kicked
local nonacess = -- what do I put here? I want the script to shut the server down if a player
-- enters that does not belong to the List of Permissions.
local playeradded = game.Players.PlayerAdded -- to shorten the typing like line 2.
servershutvalue = Instance.new("BoolValue") -- Control the server if it's going to shut down
servershutvalue.Value = false -- So it doesn't kick everyone as soon as they enter
if servershutvalue.Value == true then -- if its true that a player entered that is not allowed then shut down the whole server
game.Players:ClearAllChildren() -- it wouldn't allow me to put servershutdown so i just did that
end -- to close this part
while true do -- to do it over so if a player joins it will analyze the player.
game.Players.PlayerAdded = -- it gave me an error message saying "Expected '=' got 'if'" so i put = there.
if playeradded == ListOfPermissions then -- OH NOES DO THIS SO IT WONT SHUT DOWN ON THE ALLOWED PLAYERS!!!!!
servershutvalue = false -- so it won't shutdown
if playeradded -- this is my point where i'm stuck.. I don't know how to shutdown the server if the player is not allowed
-- I don't know how to say not equal so look at line 5 to help me.
end -- thanks for reading this.
please answer me! thanks for reading!

9 comments
I have no idea why you'd shut down the server when someone not on the list joins, just kick the player if he/she is not on the list.
Yeah, shutting down the server is kind of weird. Also you totally abuse the use of comments...
@SirNoobly I want to shut down the whole server so the script wont get bugs.
What script?
THE SCRIPT LISTED ABOVE! also, @Perci1 thats what comments are for! and i shut down the server to refresh it from any cheats/exploits a player might add. plus, i'll figure out how to use Datastore soon enough to save my work.
The script has so many things wrong with it... You need to start from the basics. http://wiki.roblox.com/index.php?title=Absolute_beginner%27s_guide_to_scripting
Well then people can just keep joining and joining and making the server shut down so you can't talk to those people in the list. And no, comments are for organization and notes, not for having conversations with yourself... It also makes it very hard to read.
It sounds like you're so much better off playing in one of these -- Build mode, A personal server, or a "created place" with saving enabled, that only you can access. This... this just seems utterly inefficient.
Errors galore. Learn the basics before you come here.