• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Scripting Question] [19.1]Revisiting an Unsolved Question

77
Posts
6
Years
  • Hey, guys.
    Still just trying to find an answer to this problem I had back in April. Any thoughts?

    Hey guys, I have a question about an item I put into the game. It's a Key Item that calls a Common Event. Here is the script:

    Code:
    ItemHandlers::UseInField.add(:SANITYCHECKER,proc{|item|
       pbCommonEvent(7)
    })

    The item works and calls the Common Event just fine, but when the Common Event ends, it says "Can't use that here."
    What do I need to do to fix that? I tried Googling and looking through the scripts but I'm not good with RMXP Scripts. I'm using Essentials v19.1.

    EDIT: I found that if I Register the item for quick use and use it in the field, it uses it just fine without saying "Can't use that here." It only says "Can't use that here." when I use it in the menu.
     
    1,682
    Posts
    8
    Years
    • Seen yesterday
    You need to return a value from the proc.
    next 0 means it wasn't used.
    next 1 means it was used, but this item isn't used up.
    next 2 means it was used, and the item was used up too.
     
    77
    Posts
    6
    Years
  • Spoiler:

    Good Lord, I feel dumb. I couldn't find this anywhere. Thank you so much for your help! It works perfectly.
     
    Back
    Top