case OBJECTID:
if(c.getItems().playerHasItem(KEYID, 1) {
Move the player to the cordinates through door or w.e u want
} else {
c.sendMessage("This house is not currently owned by you.");
}
break;
|
Hey so i was wondering if anyone could tell me how to make it so when you have a key,and click a door,it gets you through the door ONLY if you have the key. If you dont have the key it says " This house is not currently owned by you.To own a house ,look on the forums for the donator packages".
If anyone could give me a tutorial or code for this then i would greatly appreciate it
I'm using Pi erased pkz.
case OBJECTID:
if(c.getItems().playerHasItem(KEYID, 1) {
Move the player to the cordinates through door or w.e u want
} else {
c.sendMessage("This house is not currently owned by you.");
}
break;
Is this when u push a door (object) or a button (clickingbutton)?
find:
In ActionHandler.javaCode:firstClickObject
Then under it somewhere you should see:
Under that add:Code:switch(objectType) {
Replace those telex/teley ect with you're variables/loactions/ids or w.eCode:case DOORID: if(c.getItems().playerHasItem(KEYID, 1) { c.getPA().movePlayer(TELEX, TELEY, c.heightLevel); } else { c.sendMessage("This house is not currently owned by you."); } break;
Seems I got beaten to it.. oh well. ^ ^ ^
In ActionHandler (in firstClickObject method, under the switch statement):
Code:case DOOR_ID: if(c.getItems().playerHasItem(KEY_ID, 1)) { c.getPA().startTeleport(TO_X, TO_Y, TO_HEIGHT, "modern"); // If you want tele with animation... otherwise delete this. c.getPA().movePlayer(TO_X, TO_Y); //If you want the player to teleport without the teleport graphics/animation. Otherwise delete this. } else { c.sendMessage("This house is not owned by you."); c.sendMessage("To buy a house, look at the donator packages on the forums."); } break;
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |