Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 21

Thread: Noofboy12's Scripts

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Noofboy12's Scripts

    If you want to set a certain spot for a player to warp to or warp a player to this is a good script for you!
    PHP Code:
    //#CLIENTSIDE
    function onCreated() {
    this.= {player.xplayer.y,}; // our array
    }
    //declaring what this.a is wo we can use it later
    function onPlayerChats() {
      if(
    player.chat == "/Coords") {
        
    player.chat this.a;
      }
    }
    //if you use the command /Coords it will give you your x and y 
    If you want to know were the coordinates that you are standing on then type in "/Coords" and remember the first number is your x and the second number is the y value.
    Feel free to use it.
    Feel free to tell me how i can simplify it any feedback is much appreciated.
    Noof was here.

  2. #2
    Street Boss John's Avatar
    Join Date
    Jun 2013
    Location
    Lebanon
    Posts
    825
    Good job, though why did you put this.a = {player.x, player.y}; in the onCreated() function? It will only capt the players' x and y when you update the weapon, and when you move, it will still give you the same coordinates.


    Here's a better way to do it:
    PHP Code:
    //#CLIENTSIDE
    function onPlayerChats() {
      if (
    player.chat == "/coords") {
        
    player.chat player.x SPC player.y;
      }

    -Johnaudi

  3. #3
    Veteran AngryNoob's Avatar
    Join Date
    Dec 2013
    Location
    Steampunk Village! Yay!
    Posts
    149
    My first time reading one of these threads and my head already hurts.
    Hello again my little lambs! Have you missed your dear friend, genocide?!?!?!?

  4. #4
    I think theres already one, I think gp

  5. #5
    aaaaaaaaaaaaaaaaaaaaaaaaa Grief Hero's Avatar
    Join Date
    Jun 2013
    Location
    n/a
    Posts
    1,327
    You could also do
    PHP Code:
    //#CLIENTSIDE
    function onWeaponFired() {
    player.chat player.x SPC player.y;



    I saw. I conquered. I came.


  6. #6
    Ok let me explain what i did, this.a = {player.x, player.y,}; i used this o track were the player is and i use if(player.chat == "/Coords") { to trigger this.a then player.chat will say the players current x and y value. Actually i just tested a little more your right the coordinates do not change.
    Noof was here.

  7. #7
    aaaaaaaaaaaaaaaaaaaaaaaaa Grief Hero's Avatar
    Join Date
    Jun 2013
    Location
    n/a
    Posts
    1,327
    Quote Originally Posted by Noofboy12 View Post
    Ok let me explain what i did, this.a = {player.x, player.y,}; i used this o track were the player is and i use if(player.chat == "/Coords") { to trigger this.a then player.chat will say the players current x and y value. Actually i just tested a little more your right the coordinates do not change.
    Since the variable will only set when the weapon is created/updated, it will stay the same until you update it. You could also use a loop that constantly updates it, but there are limits to loops. And SPC means space, which will put a space between the two (or more) strings/variables. So if you have this:
    PHP Code:
    function onCreated() {
     
    this.hi "Hello,";
     
    this.hru "How are you?";
     echo(
    this.hi SPC this.hru);

    That would echo "Hello, How are you?"
    -------------------------------^the space is right here.

    Gonna make everything in comic sans now =]
    Last edited by Grief Hero; 03-03-2014 at 07:49 PM.


    I saw. I conquered. I came.


  8. #8
    Street Boss John's Avatar
    Join Date
    Jun 2013
    Location
    Lebanon
    Posts
    825
    Quote Originally Posted by Noofboy12 View Post
    Ok let me explain what i did, this.a = {player.x, player.y,}; i used this o track were the player is and i use if(player.chat == "/Coords") { to trigger this.a then player.chat will say the players current x and y value. Actually i just tested a little more your right the coordinates do not change.
    Actually they don't change, that's why they are supposed to.

    SPC means SPaCe. SPC = @ " " @

    When you have an array {player.x, player,} please remove the last element (the , ) it's better to have {player.x, player.y}.
    -Johnaudi

  9. #9
    Quote Originally Posted by John View Post
    Actually they don't change, that's why they are supposed to.

    SPC means SPaCe. SPC = @ " " @

    When you have an array {player.x, player,} please remove the last element (the , ) it's better to have {player.x, player.y}.
    Wow What a careless mistake on my part! Thanks for pointing that out for me. {player.x, player,} please remove the last element (the , )
    Last edited by Noofboy12; 03-06-2014 at 07:24 PM.
    Noof was here.

  10. #10
    And what is SPC mean?
    Noof was here.

Posting Permissions

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