Hey guys,
I'm trying to put together a script that will make an NPC warp from one location to a list of ~100 locations on a server. The locations will be pre-determined. That means that I will have a list of the level, x, and y position that the NPC will warp to. I just need to know how to make the NPC randomly select between these locations, and how it will warp there, etc. It will randomly choose from the specified list of levels every 5 minutes.
I have very little scripting knowledge. I'm just trying to pull this together last-minute (needs to be done by tonight, ew). Any help would be tremendously helpful.
So far, I've started scripting the NPC in a class script (I assumed this would be better than a level NPC).
This is all I have so far:
NPC Code:
function onCreated(){
setimg("block.png");
this.locationsarray = {"test.nw","30","30"}, //Random Movement
{"zeltest.nw","40","40"};
scheduleevent("0.05","MoveMe","");
}
function onMoveMe(){
temp.i=int(random(0,99));
this.location=this.locationsarray[temp.i];
scheduleevent("300","MoveMe","");
}
function onPlayertouchsme(){
}
Almost certain none of the above is correct.
Can anyone help me <3?