• 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.

[Script] Script is randomly giving me masterballs

6
Posts
8
Years
    • Seen Aug 13, 2021
    I'm trying to write a script for cubone to join my party after marowak has been defeated. The flag for her being defeated isnt set yet when ive tested so far, because the code seems to be acting REALLY weird.
    This is the line of code i have:
    Code:
    #dynamic 0x259D36
    
    #org @start
    lock
    fadeout 0x5
    faceplayer
    cry 0x68 0x0
    waitcry
    checkflag 0x2FF
    if 0x1 goto @marowakisdead
    msgbox @sadmarowak 0x1
    release
    fadein 0x1
    end
    
    #org @marowakisdead
    cry 0x69 0x0
    waitcry
    msgbox @marowakisdead1 0x1
    cry 0x69 0x0
    waitcry
    cry 0x68 0x0
    waitcry
    givepokemon 0x68 0x5 0x0 0x0 0x0 0x0
    fadescreen 0x1
    msgbox @marowakisdead2 0x1 '"Pl/h1Dase t/h17ke /h19/h2Bre /h24f..."
    hidesprite LASTTALKED
    fadescreen 0x0
    release
    fadein 0x1
    end
    
    #org @sadmarowak
    = This cubone sits in a puddle of\ntears..\lThe tears are flowing out\lof a large skull over his head.\lWhat happened...?
    
    #org @marowakisdead1
    = You hear the cry of a Marowak but\ncan't figure out where it came\lfrom.\pThe tears stop flowing from\nCubone's mask..\pCubone looks up at you..\p Is his mother here now?\pCubone hugs your leg and begins\ncrying again.
    
    #org @marowakisdead2
    = Pl/h1Dase t/h17ke /h19/h2Bre /h24f hh/h21m

    does anyone know why this is returning "player has received Master ball!" but it will also say "player has received ????????????" I'm totally stumped.
     

    DrFuji

    [I]Heiki Hecchara‌‌[/I]
    1,691
    Posts
    14
    Years
  • Its because of your msgbox types being set to 0x1. Change them to either 0x2 or 0x6 and you should get the correct messages.
     
    476
    Posts
    6
    Years
    • Seen Feb 26, 2020
    I found that instead of using 0x0 or 0x1 in the msgbox line, use MSG_SIGN and it will work fine.
     
    Back
    Top