SHARE
TWEET

Untitled

a guest Jun 12th, 2019 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //...........................................................................................................................
  2. //...SSSSSSS.........................iiii...........llll..... IIII...........llll............................dddd............
  3. //..SSSSSSSSS........................iiii...........llll..... IIII...........llll............................dddd............
  4. //..SSSSSSSSSS......................................llll..... IIII...........llll............................dddd............
  5. //.SSSSS..SSSS....oooooo....cccccc...iiii..aaaaaa...llll..... IIII.sssssss...llll..aaaaaa...nnnnnnnn....ddddddddd.sssssss....
  6. //.SSSSS........ooooooooo..cccccccc..iiii.aaaaaaaa..llll..... IIIIIssssssss..llll.aaaaaaaa..nnnnnnnnn..dddddddddddssssssss...
  7. //..SSSSSSS.....oooo.oooooocccc.cccc.iiiiiaaa.aaaaa.llll..... IIIIIsss.ssss..lllllaaa.aaaaa.nnnn.nnnnnndddd.ddddddsss.ssss...
  8. //...SSSSSSSSS.Sooo...oooooccc..ccc..iiii....aaaaaa.llll..... IIIIIssss......llll....aaaaaa.nnnn..nnnnnddd...dddddssss.......
  9. //.....SSSSSSS.Sooo...oooooccc.......iiii.aaaaaaaaa.llll..... IIII.ssssss....llll.aaaaaaaaa.nnnn..nnnnnddd...dddd.ssssss.....
  10. //........SSSSSSooo...oooooccc.......iiiiiaaaaaaaaa.llll..... IIII..sssssss..lllllaaaaaaaaa.nnnn..nnnnnddd...dddd..sssssss...
  11. //.SSSS....SSSSSooo...oooooccc..ccc..iiiiiaaa.aaaaa.llll..... IIII......ssss.lllllaaa.aaaaa.nnnn..nnnnnddd...dddd......ssss..
  12. //.SSSSSSSSSSSS.oooo.oooooocccc.cccc.iiiiiaaa.aaaaa.llll..... IIIIIsss..ssss.lllllaaa.aaaaa.nnnn..nnnnndddd.ddddddsss..ssss..
  13. //..SSSSSSSSSS..ooooooooo..ccccccccc.iiiiiaaaaaaaaa.llll..... IIIIIssssssss..lllllaaaaaaaaa.nnnn..nnnn.dddddddddddssssssss...
  14. //...SSSSSSSS.....oooooo....cccccc...iiii.aaaaaaaaa.llll..... IIII..ssssss...llll.aaaaaaaaa.nnnn..nnnn..ddddddddd..ssssss....
  15. //...........................................................................................................................
  16.  
  17.  
  18. /*
  19.  
  20. Howdy yall, Welcome
  21.  
  22. 1. Make all players join chess
  23. 2. Make the island chess show all chat messages
  24. 3. Kill a player (that is not admin)
  25. 4. Respawn that player
  26. 5. Ban that player (using an admin)
  27. 6. Make the remaining 2 players leave chess and join the private server "Developing"
  28. 7. Create another player, make him join the private server "Developing" and make him try to ban the admin
  29.  
  30. */
  31.  
  32. // This is the master server list
  33. var MasterServer = [];
  34.  
  35. class Island {
  36.     constructor(name, description, maxplayercount, locked, password) {
  37.     this.name = name || "Untitled";
  38.     this.description = description || "No Description";
  39.     this.playercount = 0;
  40.     this.maxplayercount = maxplayercount || 10;
  41.     this.locked = locked || false;
  42.     this.password = password || null;
  43.     this.id = Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
  44.     this.players = [];
  45.     }
  46.    
  47.     acceptConnection(player){
  48.         this.players.push(player);
  49.         this.playercount++;
  50.         return console.log(player.username + " Has joined " + this.name);
  51.     }
  52.    
  53.     acceptPrivateConnection(player, key){
  54.         if(key == this.password){
  55.             this.players.push(player);
  56.             this.playercount++;
  57.             return console.log(player.username + " Has joined " + this.name);
  58.         }else{
  59.             return console.log(player.username + " Has failed to join " + this.name);
  60.         }
  61.        
  62.     }
  63.    
  64.     removeConnection(player){
  65.         this.players.pop(player);
  66.         this.playercount--;
  67.         return console.log(player.username + " Has left " + this.name);
  68.     }
  69.    
  70.     kill(player){
  71.         player.health = 0;
  72.         return console.log(player.username + " has been killed");
  73.     };
  74.    
  75.     respawn(player){
  76.         player.health = 100;
  77.         return console.log(player.username + " has been respawned");
  78.     };
  79.    
  80.     getPlayerMessages(){
  81.         for(var i = 0; i < this.players.length; i++){
  82.             this.players[i].talk();
  83.         }
  84.     }
  85. }
  86.  
  87. class Player {
  88.     constructor(username, power, playerx, playery, banned, health) {
  89.     this.username = username;
  90.     this.power = power || "member";
  91.     this.playerx = playerx || 0;
  92.     this.playery = playery || 0;
  93.     this.banned = banned || false;
  94.     this.health = health || 100;
  95.     }
  96.    
  97.     ban(player) {
  98.         if(this.power == "admin"){
  99.             player.banned = true;
  100.             return console.log(this.username + " Has banned " + player.username);
  101.         }else{
  102.             return console.log(this.username + " Is not a member of staff ");
  103.         }
  104.     };
  105.    
  106.     talk(){
  107.         return console.log(this.username + " Said " + Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15));
  108.     }
  109. }
  110.  
  111.  
  112. var Player1 = new Player("Kwame","admin");
  113. var Player2 = new Player("haxxor","member");
  114. var Player3 = new Player("Dave","member");
  115.  
  116. var Island1 = new Island("Chess", "Play Chess with anyone", 25);
  117. var Island2 = new Island("Developing", "Develope Server", 5, true, "k3y");
  118. var Island3 = new Island("Medieval Roleplay", "Create your house and start roleplaying!", 100);
  119. MasterServer.push(Island1,Island2,Island3);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top