Results 1 to 8 of 8

Thread: Script doubt

  1. #1
    Normal User
    Join Date
    Apr 2013
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    4

    Script doubt

    hello, i'm trying to get my own scripts going, but i ran into a problem:

    if countitem("royal spear") < 7
    then gotolabel ("exit")
    else gotolabel ("hunting2")
    end


    BUT it always goes back to exit, no matter if I have 2 or 20 spears, I don't know why, I don't know what I'm doing wrong...

  2. #2
    Banned
    Join Date
    Jul 2012
    Posts
    402
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    16 Post(s)
    Reputation
    27
    Rep Power
    0
    if itemcount no if countitem

  3. #3
    Banned
    Join Date
    Nov 2012
    Location
    Sweden
    Posts
    450
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    65
    Rep Power
    0
    I always forget the amount held in hand, anyways here's the right piece of code by Balkarynd

    PHP Code:
    if itemcount("royalSpear") <= 7 then
    gotolabel
    ("exit")
    else
    gotolabel("hunting2")
    end 
    Last edited by PromB; 04-30-2013 at 05:54 PM.

  4. #4
    Normal User
    Join Date
    Apr 2013
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    4
    I copy-pasted exactly that, and its the same thing, it's not counting the spears at all... I'm going crazy

  5. #5
    Normal User
    Join Date
    Apr 2013
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    4
    well, you had it misspelled and I corrected it, but yeah, still not working

  6. #6
    Normal User
    Join Date
    Apr 2013
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    4
    OK I got the problem, it's not counting the spears that I have in my hand, only the ones in the backpack...
    example: If I have 15 spears in my hand it will think I have 0....
    If I have 15 in the backpack it will not leave. How do I get it to count the spears in my hand?

  7. #7
    Normal User
    Join Date
    Sep 2012
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    43
    Rep Power
    5
    Try this:
    PHP Code:
    if (itemcount("Royal Spear") + weaponamount) <= 7 then
        gotolabel
    ("exit")
    else
        
    gotolabel("hunting2")
    end 

  8. #8
    Normal User
    Join Date
    Apr 2013
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    4
    I have tried it outside the respawn and it looks good thanks!!! I will post again when I fix my script to tell you if it worked properly

Posting Permissions

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