• 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.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • 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.

Making an NPC give multiple of an item

  • 21
    Posts
    9
    Years
    • Seen May 13, 2016
    Hello everyone! First time posting here, but after a while of looking for the answer elsewhere thought might as well ask for help.
    Long story short: A group of people and I have been having issues making npcs give the player multiple of an item (Potions to be exact).
    We manage to get one potion being given but multiple just makes the game crash.
    The line of code in question is this:
    Kernel.pbReceiveItem(PBItems::POTION,5)

    It works fine once we remove the ',5' from it. Though adding in the 5 to tell rpg maker that want to make it give out 5 potions makes it look like this when viewing it in rpg maker:
    Script:Kernel.pbReceiveItem
    :(PBItems::POTION,5)

    Not really sure what's the problem so an explanation would help greatly since everyone in the group is new to this.
     
    Last edited:
    If you're writing this code in a "Event Script", you have to make a new line between the function and the arguments, like this:

    Kernel.pbReceiveItem(
    PBItems:: POTION,5)

    Remove the space after the two colons (i forgot to disable smiles D:)
     
    Back
    Top