Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15

Thread: Drag Script Help

  1. #1

    Drag Script Help

    Hi, I am farely new to scripting - I have been following through John's tutorials lately. I am trying to test my skills and make a drag command. Can someone help me with this drag command? You are supposed to activate the drag tool by saying /drag and to turn off by /undrag

    function drag()
    if (player.ap =100)
    if (player.chat = /drag)
    if (player.chat = "/undrag")
    mouse.x = mouse.x
    mouse.y = mouse.y
    player.chat = "Drag is turned on"
    else (player.chat = "You cannot use this command!")

    player.x = mousex
    player.y = mousey

    I just don't know the syntax for like how to pick the player up and stuff, how can you make it so it activates when you pick the player up.

    Thanks

  2. #2
    Big Cheese Captain
    Join Date
    Jun 2013
    Posts
    1,029
    This is not to discourage you, but I believe a drag script is too complex for you. Try to make something much more easy. An example of something easy to code is to change the player's chat when they say "hi".

    Also, just a few pointers on syntax

    - Use semi colons after each statement

    - Methods/Functions are cased in curly brackets, just imagine a box.

    PHP Code:
    function onPlayerChats() {
      if (
    condition) {
        
    // stuff
      
    } else if (condition) {
        
    // stuff
      
    } else {
        
    // stuff
      
    }

    iEra Developer / SFX Admin

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

  3. #3
    Can we skype @iMask got a few questions.

  4. #4
    aaaaaaaaaaaaaaaaaaaaaaaaa Grief Hero's Avatar
    Join Date
    Jun 2013
    Location
    n/a
    Posts
    1,327
    Quote Originally Posted by iMask View Post
    This is not to discourage you, but I believe a drag script is too complex for you. Try to make something much more easy. An example of something easy to code is to change the player's chat when they say "hi".

    Also, just a few pointers on syntax

    - Use semi colons after each statement

    - Methods/Functions are cased in curly brackets, just imagine a box.

    PHP Code:
    function onPlayerChats() {
      if (
    condition) {
        
    // stuff
      
    } else if (condition) {
        
    // stuff
      
    } else {
        
    // stuff
      
    }

    this would work if you want have multiple checks, but it seems more that he needs a combined if statements for a drag script.
    PHP Code:
    if( <argument> && <argument> && <argument>)
    {



    I saw. I conquered. I came.


  5. #5
    Veteran siclesleon's Avatar
    Join Date
    Feb 2015
    Location
    Holland , Leeuwarden
    Posts
    184

    Question

    if (player.ap =100) <<< so.. if the player has 100 attackpower then what?

    I think you mean its
    PHP Code:
    If player=group.admin {
      
    then function drag()
      else 
    null
      pause
     

    Im I right?

    correct me if im wrong (bet im :c )
    Im kinda confuse to attach the group to a script but I think my self this is wrong right away

  6. #6
    Big Cheese Captain
    Join Date
    Jun 2013
    Posts
    1,029
    Quote Originally Posted by Grief Hero View Post
    this would work if you want have multiple checks, but it seems more that he needs a combined if statements for a drag script.
    PHP Code:
    if( <argument> && <argument> && <argument>)
    {

    I was just giving an example of a correct method and if statements. It was seperate from the drag script.
    iEra Developer / SFX Admin

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

  7. #7
    Street Boss John's Avatar
    Join Date
    Jun 2013
    Location
    Lebanon
    Posts
    825
    A drag script is a bit more advanced than that.
    -Johnaudi

  8. #8
    Quote Originally Posted by John View Post
    A drag script is a bit more advanced than that.

    Ahh John, I didn't think it was tough, I try picturing the scripts in my head first then applying them, I got stuck.I tried to PM you on forum but your inbox is full, is there any way I can contact you if I have help? I don't want to spam threads.

    I can usually do simple things, I know commands and functions and arrays and things.

    Do you have a recommended thing I should try to build my skills with
    Last edited by Astyr; 12-01-2015 at 04:17 PM.

  9. #9
    aaaaaaaaaaaaaaaaaaaaaaaaa Grief Hero's Avatar
    Join Date
    Jun 2013
    Location
    n/a
    Posts
    1,327
    Quote Originally Posted by siclesleon View Post
    if (player.ap =100) <<< so.. if the player has 100 attackpower then what?

    I think you mean its
    PHP Code:
    If player=group.admin {
      
    then function drag()
      else 
    null
      pause
     

    Im I right?

    correct me if im wrong (bet im :c )
    Im kinda confuse to attach the group to a script but I think my self this is wrong right away
    what


    I saw. I conquered. I came.


  10. #10
    Quote Originally Posted by siclesleon View Post
    if (player.ap =100) <<< so.. if the player has 100 attackpower then what?

    I think you mean its
    PHP Code:
    If player=group.admin {
      
    then function drag()
      else 
    null
      pause
     

    Im I right?

    correct me if im wrong (bet im :c )
    Im kinda confuse to attach the group to a script but I think my self this is wrong right away
    You do realize ap means align point, meaning the color of your name

Posting Permissions

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