okay for tile scrolling
thats alot more confusing
since i am a nice person i will show you a script
BUT YOU CANT USE IT! cuz i use it in my own playerworld..
this is like a little snake that follows red tiles. ill post a pic too so you can see what it looks like
(and it also displays a message that can be set by any1 wearing (Owner) tag)
btw this is for free pw's so i dunno how u would change it to work to p2p
and it has 1 little bug which sometimes it freezes if its in an opened space.. (it freezes like for 1/2 a sec but its noticable)
NPC Code:
timereverywhere;
// NPC made by LiquidIce (Owner)
this.wormlength=8;
if (playerenters) {
checkarray();
timeout=.05;
}
if (timeout) {
movearray();
findnext();
//here we do the updates and junk
putobjects();
//do message
displaymessage();
timeout=.075;
}
function checkarray() {
setarray wormx, this.wormlength+1;
setarray wormy, this.wormlength+1;
for (this.i=0;this.i<this.wormlength;this.i++) {
if (wormx[this.i]=0) { wormx[this.i]=x; }
}
for (this.i=0;this.i<this.wormlength;this.i++) {
if (wormy[this.i]=0) { wormy[this.i]=y; }
}
}
function movearray() {
this.i=this.wormlength;
while (this.i>0) {
wormx[this.i]=wormx[this.i-1];
wormy[this.i]=wormy[this.i-1];
this.i--;
}
}
function findnext() {
this.bad=1;
while (this.bad=1) {
this.check=int(random(0,12));
//left
if (this.check<3) {
this.checktile=board[(wormx[0]-1)+(64*wormy[0])];
if (this.checktile=2358) {
wormx[0]=wormx[1]-1;
wormy[0]=wormy[1];
this.bad=0;
}
}
//right
if (this.check>3&&this.check<6) {
this.checktile=board[(wormx[0]+1)+(64*wormy[0])];
if (this.checktile=2358) {
wormx[0]=wormx[1]+1;
wormy[0]=wormy[1];
this.bad=0;
}
}
//up
if (this.check>9&&this.check<13) {
this.checktile=board[wormx[0]+(64*(wormy[0]-1))];
if (this.checktile=2358) {
wormx[0]=wormx[1];
wormy[0]=wormy[1]-1;
this.bad=0;
}
}
//down
if (this.check>6&&this.check<9) {
this.checktile=board[wormx[0]+(64*(wormy[0]+1))];
if (this.checktile=2358) {
wormx[0]=wormx[1];
wormy[0]=wormy[1]+1;
this.bad=0;
}
}
//end while
}
//end function
}
function putobjects() {
for (this.i=0;this.i<this.wormlength;this.i++) {
board[wormx[this.i]+(64*wormy[this.i])]=1822;
updateboard wormx[this.i],wormy[this.i],1,1;
}
//delete last
board[wormx[this.wormlength]+(64*wormy[this.wormlength])]=2358;
updateboard wormx[this.wormlength],wormy[this.wormlength],1,1;
}
if (playerchats&&startswith(setmessage,#c)&&strequals (#g,Owner)) {
setstring server.wormmessage,#e(11,strlen(#c)-11,#c);
}
if (playerchats&&startswith(resetmessage,#c)&&strequa ls(#g,Owner)) {
setstring server.wormmessage,;
}
function displaymessage() {
if (!strequals(server.wormmessage,)) {
showimg 100,@#s(server.wormmessage),wormx[0]-1,wormy[0]-1;
}
}
check attachment too