Random

Discussion in 'Plugin Development' started by Herbert_The_Pervert, Jun 25, 2014.

Thread Status:
Not open for further replies.
  1. Hello Everyone
    I had made 12 locations that you can set
    The only thing i am stuck on is to make the player to tp to the random location
    [There can not be more than 1 player at one location]
     
  2. Offline

    Traks

    1. Add all the locations to a list
    2. Get a random number using the Random class or Math.random() from 0 to the list size - 1
    3. Get the location at that position in the list
     
  3. Offline

    Zupsub

    Works the same with an array.
    Probably want to look on Random#nextInt()
     
Thread Status:
Not open for further replies.

Share This Page