7 Replies Latest reply: Apr 9, 2012 8:38 AM by markerline RSS

    Random Array?

    LukeElChul Community Member

      Im making a random drop item system.


      I was thinking of making a array like this:


      var Items:Array = ["HP","ST","SWORD"]




      if(Items == SWORD){

      //drop sword

      //do code here



      but i have no idea of how to access and use 1 value from an array.


      I think i need to use something like math.floor or math.random but i dont know how to go foward with this.



      Thanks in advance.