its really basic, you just load the rom (click on this icon: ), write/paste the script, hit the gears (click on this icon: ) and then click Copy. Then go into Advance Map and paste the offset. It's that simple!
checkflag 0xFLAG // This checks if the player has defeated the Elite Four. In the Champion's script, add a "setflag 0xFLAG" command. Make the two FLAGs consistent (you won't be able to compile this script until the FLAG is a number, so I recommend you allocate a flag and use it for all the Gym Leaders).
if 0x1 goto @snippet13 // If the flag is set - if the player has defeated the Champion - then the script will go to "@snippet13".
setvar 0x8004 0x2
setvar 0x8005 0x2
trainerbattle 0x1 0x19E 0x0 @string1 @string2 @snippet1
if 0x0 goto @snippet2
msgbox @string3 MSG_KEEPOPEN //"There are all kinds of TRAINERS in..."
#org @snippet13 // This is where the script will go to if the player has defeated the Champion.
checktrainerflag 0xTRAINERID // This checks if you have already rematched Brock. Replace TRAINERID with the ID number that the trainer has, as shown in A-Trainer (for example, ordinary Brock's Trainer ID is 19E).
compare LASTRESULT 0x1 // If the playe has rematched Brock...
if 0x1 goto @snippet15 // ...then go to "@snippet15". If not...
trainerbattle 0x1 0xTRAINERID 0x0 @string8 @string9 @snippet14 //... then commence a battle with Brock after displaying the text located "@string8". When the player wins, display the text located at "@string9". Go to "@snippet14".
#org @snippet14 // This is where the script will go to once the player has defeated Brock once again.
msgbox @string4 MSG_KEEPOPEN // From here...
checkitemroom ITEM_TM39 0x1 // Does the player have room in the TM Case?
compare LASTRESULT 0x0 // If no...
if 0x1 goto @snippet4 // ... goto "@snippet4". Otherwise...
additem ITEM_TM39 0x1 // ... add TM39 to the player's inventory...
loadpointer 0x0 @string5 //"[player] received TM39\nfrom BROCK..." // ...then load the pointer at "@string5" to be displayed when...
giveitem2 ITEM_TM39 0x1 0x101 // ...the player receives TM39.
msgbox @string6 MSG_KEEPOPEN // This displays the text located at "@string6".
release // Of course, you can change the contents of "@snippet14" to whatever script you wish.
#org @snippet15 // This is where the script will go if the player has rematched Brock and are now interacting with him once more.
msgbox @string3 MSG_KEEPOPEN //"There are all kinds of TRAINERS in..." // This displays the text located at "@string3".
= So, you're here. I'm BROCK.\nI'm PEWTER's GYM LEADER.\pMy rock-hard willpower is evident\neven in my POKéMON.\pMy POKéMON are all rock hard, and\nhave true-grit determination.\pThat's right - my POKéMON are all\nthe ROCK type!\pFuhaha! You're going to challenge\nme knowing that you'll lose?\pThat's the TRAINER's honor that\ncompels you to challenge me.\pFine, then!\nShow me your best!\c\h0B[Ke]À
= I took you for granted, and so\nI lost.\pAs proof of your victory, I confer\non you this[.]the official POKéMON\lLEAGUE BOULDERBADGE.\p\c\h06Á[player] received the BOULDERBADGE\nfrom BROCK!\c\h17\c\h0BÇÀ\c\h08\n\c\h08[Ke]\c\h18\p\c\h06ÇJust having the BOULDERBADGE makes\nyour POKéMON more powerful.\pIt also enables the use of the\nmove FLASH outside of battle.\pOf course, a POKéMON must know the\nmove FLASH to use it.
= There are all kinds of TRAINERS in\nthis huge world of ours.\pYou appear to be very gifted as a\nPOKéMON TRAINER.\pSo let me make a suggestion.\pGo to the GYM in CERULEAN and test\nyour abilities.
= Wait!\nTake this with you.
= [player] received TM39\nfrom BROCK.
= A TM, Technical Machine, contains a\ntechnique for POKéMON.\pUsing a TM teaches the move it\ncontains to a POKéMON.\pA TM is good for only one use.\pSo, when you use one, pick the\nPOKéMON carefully.\pAnyways[.]\nTM39 contains ROCK TOMB.\pIt hurls boulders at the foe and\nlowers its SPEED.
= You don't have room for this.
= Now you're an official POKéMON\nMASTER, let's have a rematch!
= Truly, you do deserve the title\nof POKéMON MASTER!
Are you using JPAN's FireRed Hacked Engine? special 0x58 in that patch lets you change the wild pokemon, so you could just have scripts that activate that special/deactiavte it upon entering different areas.
ill send you a script for the rematch later, ive gotta do something atm sorry!