View Single Post
  #5  
Old 07-28-2012, 12:32 AM
Bleachlover551 Bleachlover551 is offline
Soul Reaper
Bleachlover551's Avatar
Join Date: Jul 2012
Location: Brunswick
Posts: 34
Bleachlover551 is an unknown quantity at this point
Quote:
Originally Posted by ffcmike View Post
An easier more efficient approach would be to create a multi-dimensional array of warp coordinates:

PHP Code:
function onCreated(){
  
//x, y
  
this.warplocations = {
    {
510},
    {
520},
    {
530},
    {
540},
    {
1510},
    {
1520},
    {
1530},
    {
1540},
  };
  
this.warpamount this.warplocations.size();

And then increment an array index variable each time a player enters:

PHP Code:
function onPlayerEnters(){
  
player.this.warplocations[this.warpindex][0];
  
player.this.warplocations[this.warpindex][1];
  
//Use % to reset a value back to 0 if it overlaps specified value
  
this.warpindex = (this.warpindex 1) % this.warpamount;

Thanks So Much! This Will Help Me A Lot In My Event(s)! Also do u have a kickall script? if i may ask?
Reply With Quote