Page 2 of 2 FirstFirst 1 2
Results 11 to 19 of 19

Thread: Questions about scripting

  1. #11
    Street Boss Mr LebJoe S's Avatar
    Join Date
    Aug 2014
    Location
    liechtestein
    Posts
    781
    Quote Originally Posted by Grief Hero View Post
    that's why you learn if you don't know how
    To learn, he needs someone to teach, and that's why there is people on Era-Go that might help, if you don't want to help, no need to check the thread, if you don't even know how to script.

    I never knew I will say this to an Admin one time... Wow... It makes me feel strong
    ineffable.

  2. #12
    Not Actually Banned Yet Bulletzone's Avatar
    Join Date
    Apr 2015
    Location
    United Kingdom
    Posts
    2,849
    You will be waiting a good 48 Hours+ for your account to be approved.
    "A fool thinks they know everything but a wise person knows there's something to learn from everyone"
    -
    "Great leaders don't complain about the tools they are given. They work to sharpen them"

  3. #13
    Quote Originally Posted by Bulletzone View Post
    You will be waiting a good 48 Hours+ for your account to be approved.
    I'm sure he got that figure out

  4. #14
    Big Cheese Slapjack's Avatar
    Join Date
    Jul 2015
    Location
    Kuwait
    Posts
    1,768
    Quote Originally Posted by Bulletzone View Post
    You will be waiting a good 48 Hours+ for your account to be approved.
    I've been waiting since about 4 days ago, still nothing.


    League Of Legends Player
    Server: Eu West
    Name: SlapjackQ8
    Add me, everyone is welcome

  5. #15
    Street Boss John's Avatar
    Join Date
    Jun 2013
    Location
    Lebanon
    Posts
    825
    If you have your own custom walking system, you can easily making it walkthru players by disabling the wallcheck on near players.
    What is a "lucky block"?

    And for the /kickall function it can be easily made by the following class/npc:
    PHP Code:
    function onPlayerChats() {
      if (
    player.chat == "/kickall" && player.guild == "Events Team") { // You must have Events Team tag on.
        
    for (temp.pl level.players) {
          if (
    temp.pl.guild != "Events Team"temp.pl.setlevel2("levelname.nw"xy); // Not sure whether that's the correct syntax of the setlevel2 function, I haven't coded for a while
        
    }
      }

    -Johnaudi

  6. #16
    Big Cheese Slapjack's Avatar
    Join Date
    Jul 2015
    Location
    Kuwait
    Posts
    1,768
    Quote Originally Posted by John View Post
    If you have your own custom walking system, you can easily making it walkthru players by disabling the wallcheck on near players.
    What is a "lucky block"?

    And for the /kickall function it can be easily made by the following class/npc:
    PHP Code:
    function onPlayerChats() {
      if (
    player.chat == "/kickall" && player.guild == "Events Team") { // You must have Events Team tag on.
        
    for (temp.pl level.players) {
          if (
    temp.pl.guild != "Events Team"temp.pl.setlevel2("levelname.nw"xy); // Not sure whether that's the correct syntax of the setlevel2 function, I haven't coded for a while
        
    }
      }

    Thanks John!
    What I meant with lucky block is the block that u grab it to win or lose in chances, but it's ok I don't need it anymore.


    League Of Legends Player
    Server: Eu West
    Name: SlapjackQ8
    Add me, everyone is welcome

  7. #17
    Soldier Corrosive's Avatar
    Join Date
    Oct 2015
    Location
    Austria
    Posts
    37
    Hey john, what does the for (temp.pl : level.players){...} do?

    Cant you just do this:

    Code:
    function onPlayerChats() { 
      if (player.chat == "/kickall" && player.guild == "Events Team") {
          if (level.players.guild != "Events Team") level.players.setlevel2("levelname.nw", x, y);
      } 
    }
    ______________________________

  8. #18
    Big Cheese Captain
    Join Date
    Jun 2013
    Posts
    1,029
    Quote Originally Posted by Corrosive View Post
    Hey john, what does the for (temp.pl : level.players){...} do?

    Cant you just do this:

    Code:
    function onPlayerChats() { 
      if (player.chat == "/kickall" && player.guild == "Events Team") {
          if (level.players.guild != "Events Team") level.players.setlevel2("levelname.nw", x, y);
      } 
    }
    Logically, you would loop through all the players in that specific level, meaning you have to have a loop. for (temp.pl : players) { would go through each of the players in the level and we can manipulate each of the players differently inside the curly brackets using if statements.

    Say there's 2 players in a level: player 1 and player 2. If I were to have a script that goes something like:
    PHP Code:
    for (temp.pl players) {
      
    temp.pl.chat "Hi";

    The script would go to player 1, make his/her chat hi, then go to player 2 and make his/her chat hi.
    iEra Developer / SFX Admin

    Need help? Contact me:
    Email: [email protected]

  9. #19
    Soldier Corrosive's Avatar
    Join Date
    Oct 2015
    Location
    Austria
    Posts
    37
    Quote Originally Posted by iMask View Post
    Logically, you would loop through all the players in that specific level, meaning you have to have a loop. for (temp.pl : players) { would go through each of the players in the level and we can manipulate each of the players differently inside the curly brackets using if statements.

    Say there's 2 players in a level: player 1 and player 2. If I were to have a script that goes something like:
    PHP Code:
    for (temp.pl players) {
      
    temp.pl.chat "Hi";

    The script would go to player 1, make his/her chat hi, then go to player 2 and make his/her chat hi.
    Thanks for the fast answer, and sorry for my slow Reply =)

    so for is a loop that Loops through the Parameters you establish?

    I made an example Code:
    Code:
    //This Code should act as a calculator that divides two numbers, I want it to calculate and Show the result over the heads of every single Player in the Level if the Manager says showresult
    function onCreated(){
      temp.a = 6;
      temp.b = 0;
      temp.a = onDivide(temp.a, temp.b);
    
      function onDivide(a, b){
      if (b != 0){
      temp.result = a / b;
      return temp.result;
      }
      else {
      temp.result = "You cannot divide by 0!";
      return temp.result
      }
      }
      function onResult(temp.result){
      player.chat = "Result: " @ temp.result;
      }
      
      //here starts the part I scripted with my new Knowledge
      function onPlayerChats(){
    	if (player.chat == "showresult" && player.guild == "Manager"){
    	  for (temp.pl : level.players){
    	    onResult(temp.a); //will the result show up over the heads of every single player in the level?
           }	
        }
      }
    }
    Would it work? Thanks for help =)
    ______________________________

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •