Page 2 of 5 FirstFirst 1 2 3 4 ... LastLast
Results 11 to 20 of 45

Thread: iMask's Scripts

  1. #11
    Big Cheese Captain
    Join Date
    Jun 2013
    Posts
    1,029
    Timer Script (haven't tested this yet)

    PHP Code:
    //Coded by iMask
    function onPlayerChats () {
       for (
    this.i=0;this.chat=="/timer";this.i++) {
          
    this.chat this.i;
          
    sleep (1);
       }
       if (
    this.chat == "/stoptimer") {
          break;
             
    this.chat = @"this.i"@;
       }

    Can someone please confirm if I'm on the right track?
    Last edited by iMask; 12-11-2014 at 08:24 PM.
    iEra Developer / SFX Admin

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

  2. #12
    Scripting Team Alpho's Avatar
    Join Date
    Jun 2013
    Location
    California
    Posts
    32
    PHP Code:
    function onPlayerChats() {
      if (
    player.chat == "/timer") {
        
    onTimeOut();
      } else if (
    player.chat == "/stoptimer") {
        
    this.chat this.i;
        
    this.0;
        
    setTimer(0);
      }
    }

    function 
    onTimeOut() {
      
    this.++;
      
    this.chat this.i;
      
    setTimer(1);


  3. #13
    Era Philosopher MikeyUK's Avatar
    Join Date
    Jul 2013
    Location
    United States
    Posts
    2,733
    /Start Topic























































































































































































































































    /End Topic

    Click the Spoiler to see my fan art!
     Spoiler



    - 2012 iEra Player -
    - 2013 Era-GO Member -
    - iEra Ex-Player Relations -
    - Era-GO Ex-Moderator (Twice) -


  4. #14
    Big Cheese Captain
    Join Date
    Jun 2013
    Posts
    1,029
    Mouse Click warp (haven't tested this yet)
    PHP Code:
    //Coded by iMask
    //#CLIENTSIDE
       
    function onKeyPressed () {
          if (
    this.key == "1") {
             
    this.warp true;
          } else {
          
    this.warp false;
          }
       }
    }

       function 
    onLeftMouseClick () {
          if (
    this.warp == "true") {
             
    player.mousex;
             
    player.mousey;
          }
       } 
    Again, can someone confirm this is correct?
    iEra Developer / SFX Admin

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

  5. #15
    aaaaaaaaaaaaaaaaaaaaaaaaa Grief Hero's Avatar
    Join Date
    Jun 2013
    Location
    n/a
    Posts
    1,327
    Why bother creating and posting a script, if you don't test it first? Test and post it if it does not work.


    I saw. I conquered. I came.


  6. #16
    Big Cheese Captain
    Join Date
    Jun 2013
    Posts
    1,029
    Event Door script
    PHP Code:
    //Coded by iMask
    //#CLIENTSIDE
       
    function onCreated () {
          
    setimg ("door.png");
          
    setshape (0,32,32);
       }

       function 
    onPlayerChats () {
          if (
    player.chat == "/open" && clientr.staff == 1) {
          
    show();
       }
          if (
    player.chat == "/close" && clientr.staff == 1) {
          
    hide();
          }
       } 
    Last edited by iMask; 01-10-2015 at 01:41 AM.
    iEra Developer / SFX Admin

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

  7. #17
    aaaaaaaaaaaaaaaaaaaaaaaaa Grief Hero's Avatar
    Join Date
    Jun 2013
    Location
    n/a
    Posts
    1,327
    Quote Originally Posted by iMask View Post
    Event Door script
    PHP Code:
    //Coded by iMask
    //#CLIENTSIDE
       
    function onCreated () {
          
    setimg ("door".png); // Not quite sure why the whole image name isn't in quotations. 
          
    setshape (0,32,32);
       }

       function 
    onPlayerChats () {
          if (
    player.chat == "/open" && clientr.staff == 1) {
          
    show//Not the proper syntax for it, should be show();
       
    }
          if (
    player.chat == "/close" && clientr.staff == 1) {
          
    hide//Again, not the proper syntax, should be hide();
          
    }
       } 
    Try using Boolean too, alongside else if statements.


    I saw. I conquered. I came.


  8. #18
    Street Boss John's Avatar
    Join Date
    Jun 2013
    Location
    Lebanon
    Posts
    825
    Quote Originally Posted by iMask View Post
    Event Door script
    PHP Code:
    //Coded by iMask
    //#CLIENTSIDE
       
    function onCreated () {
          
    setimg ("door".png);
          
    setshape (0,32,32);
       }

       function 
    onPlayerChats () {
          if (
    player.chat == "/open" && clientr.staff == 1) {
          
    show;
       }
          if (
    player.chat == "/close" && clientr.staff == 1) {
          
    hide;
          }
       } 
    The ".png" is actually in the image name :P

    That would be: setimg("door.png");

    Also, even though it works, but it's preferable to use Gs2 over Gs1: show; becomes this.show(); and hide; becomes this.hide();
    -Johnaudi

  9. #19
    Scripting Team Alpho's Avatar
    Join Date
    Jun 2013
    Location
    California
    Posts
    32
    Code:
    //#CLIENTSIDE
    function onCreated() {
      this.image = "door.png";
    }
    
    function onPlayerChats() {
      if (clientr.isStaff == false) return;
      if (player.chat == "/open")
        this.show();
      else if (player.chat == "/close")
        this.hide();
    }

  10. #20
    Big Cheese Captain
    Join Date
    Jun 2013
    Posts
    1,029
    Quote Originally Posted by Grief Hero View Post
    Try using Boolean too, alongside else if statements.
    Sorry, how would I do that?
    Quote Originally Posted by John View Post
    Also, even though it works, but it's preferable to use Gs2 over Gs1: show; becomes this.show(); and hide; becomes this.hide();
    Didn't know that! :P

    Thanks John and Alpho
    iEra Developer / SFX Admin

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

Posting Permissions

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