Add Teleport Buttons in Quest Tab [RSPS TUT]

.Judgement

Onyx user!
Reputation
0
Ok first, you will need the files Actionbuttons.java & Frames.java.
In Frames.java find:


Code:
setTab(p, 75, 274);

Then, under that add:
:

Code:
setString(p, "", 274, #);

In the "" add the name of the teleport, for example

Code:
setString(p, "<col=33FF33>TELEPORT NAME", 274, #);

Home will be in green lettering.
The # is the button ID, so you will need to memorize that for Actionbuttons.java
The 274 is the ID of the Tab so just keep that the same.
OK, now that you have the button and everything made, save and close Frames.java and open up Actionbuttons.java.




Code:
case 274:



Code:
if (buttonId == #) {

Again, the # is the button ID so you MUST use the same ID that you used in Frames.java!
Under that add:


Code:
p.teleportTo(XXXX, YYYY, H, 4, 0, 8939, 8941, 1576, 0, 1577, 0);

Be sure to fill in the x coord, y coord, and the height!
And if you would like to send a message when you use the button add this under the teleport:


Code:
p.frames.sendMessage(p, "YOUR TEXT HERE");
}
break;

That's it so save and compile and it should work!

Note: if you want to add more buttons, be sure that after the first }
do "else if"

so it should be like this; here are two lines of code:


Code:
} else if (buttonId == 8) {
p.teleportTo(2966, 3379, 0, 4, 0, 8939, 8941, 1576, 0, 1577, 0);
p.frames.sendMessage(p, "Welcome to Falador!");
} else if (buttonId == 9) {
p.teleportTo(2882, 5310, 2, 4, 0, 8939, 8941, 1576, 0, 1577, 0);
p.frames.sendMessage(p, "Welcome to Godwars!");
p.frames.sendMessage(p, "Because of the Bitter cold you begin to weaken!");
}
break;
 
Back
Top