Use an enum to add more then one option.
|
Hey everyone, I'm trying to figure out two things to add to my server.
1) How can i make a teleport that will teleport you to a random coordinate out of several. Example: i click on a portal and it will either have a chance of sending me to castle wars bank, mage bank, and keldagrim bank. I want it completely random which one it will choose.
2) How can i make a zone private like in fight caves? Kind of like a private dungeon or something along those lines..
Thank you!
Ok then, but how do i add other ones to the coordinate list to randomly choose?
Bump.
Look in my releases.
just add a misc.random(#) with the teleport
Code:if (playerCommand.startsWith("runeserver")) { int Random; Random = Misc.random(100); if (Random <= 100 && Random >= 80) { c.getPA().movePlayer(x, y, h); } else if (Random <= 80 && Random >= 60) { c.getPA().movePlayer(x, y, h); } else if (Random <= 60 && Random >= 40) { c.getPA().movePlayer(x, y, h); } else if (Random <= 40 && Random >= 20) { c.getPA().movePlayer(x, y, h); } else if (Random <= 20 && Random >= 0) { c.getPA().movePlayer(x, y, h); } }
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |