That seems to work. I’m trying to fix the providence boat script. However, it wont move. At all. I get the cannons to fire fine
[CODE]if(actioncannon){
with(getnpc(#N)){
test = strtofloat(#s(this.hp))-1;
setstring this.hp,#v(test);
setcharprop #c,#s(this.hp) left;
}
}
if (created) {
setstring this.hp,3;
setgif ship1.gif;
drawunderplayer;
noplayeronwall;
this.mdir = -1;
this.speed = 3;
setstring this.warp,abcdefghijklmnopqrstuvwxy;
timeout = 0.1;
}
if (playerdies) {detachplayer};
if (created || initialized) {
setstring this.startlevel,#L;
setstring this.startx,#v(x);
setstring this.starty,#v(y);
setshape 1,1416,2016;
}
if (actionmoveship) {
if (mdir>=0) {
mdir = int(strtofloat(#p(0)));
if (mdir>=0 && mdir<=3) {
setplayerprop #c,Aye Sir!;
this.mdir = mdir;
}
}
}
if (playerchats) {
if (strequals(#g,Staff)) {
if (strequals(#c,unstick boats)||strequals(#c,unstuck boats)||strequals(#c,warp boats))
setlevel2 #s(this.startlevel),strtofloat(#s(this.startx)),strtofloat(#s(this.starty));
}
setstring this.textp,#a;
this.testx = playerx;
this.testy = playery;
this.testx2 = x;
this.testy2 = y;
}
if (playerchats && (playerx in |x,x+14|) && (playery in |y,y+26|)) {
if (strequals(#c,stop)) {
setplayerprop #c,Aye Sir!;
this.mdir = -1;
}
}
if (timeout) {
setcharprop #c,#s(this.hp) left;
if(strtofloat(#s(this.hp))< 2){
setimg shipbeat.png;
}
if(strtofloat(#s(this.hp))<=0){
tokenize #s(this.attached);
for(i=0;i<tokenscount;i++){
with(getplayer(#t(i))){
detachplayer;
}
}
setimg ship1.gif;
setstring this.hp, 3;
setlevel2 #s(this.startlevel),strtofloat(#s(this.startx)),strtofloat(#s(this.starty));
}
this.playersattached=0;
setstring this.attached,;
for(this.player=0;this.player<playerscount;this.player++) {
with (players[this.player]) {
if (playerattachid==id) {
if (lindexof(#a,this.attached)<0)
addstring this.attached,#a;
this.playersattached ++;
}
}
}
setstring this.playersattached,#v(this.playersattached);
if (this.mdir>=0) {
dir = this.mdir;
dist = this.speed;
newx = x + vecx(dir)*dist;
newy = y + vecy(dir)*dist;
levxmove = (newx<-4? -1 : newx>54? 1 : 0);
levymove = (newy<-4? -1 : newy>52? 1 : 0);
warped = false;
if (levxmove!=0 || levymove!=0) {
// Level warp
if (startswith(providence,#L)) {
levx = indexof(#e(11,1,#L),#s(this.warp))+1;
levy = strtofloat(#e(14,2,#L));
if (levx>=1 && levy>=1 &&
(levx+levxmove in |1,16|) && (levy+levymove in |1,16|)) {
setstring this.dest,providence_#e(levx+levxmove-1,1,#s(this.warp))-;
setstring this.test,providence_#e(levx+levxmove-1,1,#s(this.warp))-;
if (levy+levymove<10) setstring this.dest,#s(this.dest)0;
setstring this.dest,#s(this.dest)#v(levy+levymove).nw;
setlevel2 #s(this.dest),(levxmove<0? 54 : levxmove>0? -4 : x), (levymove<0? 52 : levymove>0? -4 : y);
warped = true;
}
}
}
if (warped==false) {
if (!onwater2(newx+4.1,newy+4.1,5.8,7.8) ||
onwall2(newx+4.1,newy+4.1,5.8,7.8))
this.mdir = -1; // stop
else
move vecx(dir)*dist,vecy(dir)*dist,1,1;
}
}
if (strtofloat(#s(this.playersattached))==0&&(!strequals(#L,#s(this.startlevel))||strequals(#L,#s(this.startlevel))&&!(x==strtofloat(#s(this.startx))||y==strtofloat(#s(this.starty))))) {
this.warptime++;
if (this.warptime>=300) {
setlevel2 #s(this.startlevel),strtofloat(#s(this.startx)),strtofloat(#s(this.starty));
this.warptime=0;
}
} else {
this.warptime=0;
}
timeout = 1;
}
//#CLIENTSIDE
if(actionprojectile){
triggeraction x,y,cannon,;
}
if (created) {
blockagain;
setgif ship1.gif;
setshape2 14,26,{
0, 0, 0, 0,22,22,22,22,22,22, 0, 0, 0, 0,
0, 0, 0,22,22,22,22,22,22,22,22, 0, 0, 0,
0, 0, 0,22,22,22, 3, 3,22,22,22, 0, 0, 0,
0, 0,22, 0, 3, 3, 3, 3, 3, 3, 0,22, 0, 0,
0, 0,22, 0, 3, 3, 0, 0, 3, 3, 0,22, 0, 0,
0, 8,22, 0, 0, 0, 0, 0, 0, 0, 0,22, 8, 0,
8, 8,22, 0, 0, 0,22,22, 0, 0, 0,22, 8, 8,
8, 8,22, 0, 0,22, 3, 3,22, 0, 0,22, 8, 8,
8, 8,22, 0, 0,22, 3, 3,22, 0, 0,22, 8, 8,
0, 0,22, 0, 0, 0, 3, 3, 0, 0, 0,22, 0, 0,
0, 0,22, 0, 0, 0, 3, 3, 0, 0, 0,22, 0, 0,
0, 0, 0, 0, 0,22, 3, 3,22, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0,22, 3, 3,22, 0, 0, 0, 0, 0,
0, 8,22, 0, 0, 0,22,22, 0, 0, 0,22, 8, 0,
8, 8,22, 0, 0, 0, 0, 0, 0, 0, 0,22, 8, 8,
8, 8,22, 0, 0, 0, 0, 0, 0, 0, 0,22, 8, 8,
8, 8,22, 0, 0, 0,22,22, 0, 0, 0,22, 8, 8,
8, 8,22,22, 0,22,22,22,22, 0,22,22, 8, 8,
8, 0,22,22,22, 0,22,22, 0,22,22,22, 0, 8,
0, 0,22,22,22,22,22,22,22,22,22,22, 0, 0,
0, 0,22,22,22,22,22,22,22,22,22,22, 0, 0,
0, 0, 0,22,22,22,22,22,22,22,22, 0, 0, 0,
0, 0, 0, 0,22,22,22,22,22,22, 0, 0, 0, 0,
0, 0, 0, 0, 0,22,22,22,22, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,22,22, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};
}
if (playerenters || timeout) {
if(strtofloat(#s(this.hp)<2)){
setimg shipbeat.png;
}
if (playerattached) {
if(playerx+2.5<=x+3 || playerx+1>=x+11.5) {
detachplayer;
}
//cannon 1
if(playery in |y+4,y+6| && playerx in |x+2.5,x+3.5|){
if(strequals(#m,pull)){
if(playerdir==1){
setshootparams cannon;
setplayerprop #c,FIRE!;
shoot x-.5,y+7,z,3,0,0,prov_cannonball,;
setani idle,;
}
}
}
//cannon 2
if(playery in |y+11,y+13| && playerx in |x+2.5,x+3.5|){
if(strequals(#m,pull)){
if(playerdir==1){
setshootparams cannon;
setplayerprop #c,FIRE!;
shoot x-.5,y+14,z,3.14,0,0,prov_cannonball,;
setani idle,;
}
}
}
//cannon 3
if(playery in |y+4,y+6| && playerx in |x+8.5,x+9.5|){
if(strequals(#m,pull)){
if(playerdir==3){
setshootparams cannon;
setplayerprop #c,FIRE!;
shoot x+11.5,y+7,z,0,0,0,prov_cannonball,;
setani idle,;
}
}
}
//cannon 4
if(playery in |y+11,y+13| && playerx in |x+8.5,x+9.5|){
if(strequals(#m,pull)){
if(playerdir==3){
setshootparams cannon;
setplayerprop #c,FIRE!;
shoot x+11.5,y+14,z,0,0,0,prov_cannonball,;
setani idle,;
}
}
}
if ((strequals(#m,grab) || strequals(#m,pull)) && playerdir==2) {
mdir = -1;
for (i=0; i<4; i++)
if (keydown(i)) mdir = i;
if (mdir>=0)
triggeraction playerx+1.5,playery+2,moveship,#v(mdir);
}
} else {
if (playery+2 in |y+11,y+13|&&((playerx+1.5 in |x+2,x+4| && playerdir==3 && keydown(3)) || (playerx+1 in |x+10,x+12| && playerdir==1 && keydown(1)))) {
attachplayertoobj 0,id;
}
}
timeout = 0.05;
}
if (playerenters) playlooped ocean.wav;
if (playerleaves) stopsound ocean.wav;
[/CODE]