So I've seen a couple methods of this but they don't seem to work for what I'm looking do to...
I'm using this push for another section of code and I don't see why it would not also work for this one in question.
var npc = new Array();
npc.push([
[5,25,10],
]);
npc.push([
[18,28,38],
]);
npc.push([
[1,2,3],
]);
I want to set this up so I can call something like...
LoadNpc(2);
I want it to check the 2nd npc array and set the 3 numbers to variable..
hp = 18;
atk = 28;
def = 38;
id = 2; //current loaded npc's id
I'm sure I've been over thinking how to do this and I can't get anything to work correctly. If anyone has a simple javascript to this properly I would be very thankful.