• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • 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] Creating an item that calls a common event

  • 143
    Posts
    11
    Years
    • Seen Jun 11, 2021
    I'm trying to make a key item with common events. Whenever I try to use it, it just says "Can't use that here."

    Code:
    ItemHandlers::UseFromBag.add(:TESTITEM,proc{|item| next 2})
    
    ItemHandlers::UseInField.add(:TESTITEM,proc{|item|
       pbCommonEvent(5)
    ))

    This is what the code for the item looks like. I'm not sure what I did wrong.
     
    I'm trying to make a key item with common events. Whenever I try to use it, it just says "Can't use that here."

    Code:
    ItemHandlers::UseFromBag.add(:TESTITEM,proc{|item| next 2})
    
    ItemHandlers::UseInField.add(:TESTITEM,proc{|item|
       pbCommonEvent(5)
    ))

    This is what the code for the item looks like. I'm not sure what I did wrong.


    have you tried changing

    pbCommonEvent(5) to $game_temp.reserve_common_event(5)
     
    That didn't solve anything. It still said "Can't use that here." So I tried placing it in the UseFromBag instead, and it said reserve_common_event wasn't a defined method.
     
    Code:
    ItemHandlers::UseInField.add(:TESTITEM,proc{|item|
       pbCommonEvent(5)
    [COLOR="Red"])[/COLOR])
    If this is actually your code, the red parenthesis here should be a bracket
     
    I didn't notice that. Fixed that, but nothing's changed. I'm still getting "Can't use that here." whenever I try to use the key item.

    Nevermind! The issue was my fault. It turns out, I had some lines improperly commented out.
     
    Last edited by a moderator:
    Back
    Top