| Com013 |
01-13-2003 09:28 PM |
Bridge
1 Attachment(s)
I have only little experience with the commands which were previously p2p only, and so I have got problems making a bridge.
Here is my current script (yes, I know it is not looking nice):
NPC Code:
// Script made by Com013
if (created) {
setarray btiles,14*9;
for (i=0; i<9; i++)
for (j=0; j<14; j++) {
if (i<2 || i>=7)
btiles[i*14+j] = 22;
else
btiles[i*14+j] = 0;
}
setshape2 14,9,btiles;
setarray btiles,0;
drawoverplayer;
dontblock;
}
//#CLIENTSIDE
if (playerenters || timeout) {
if (playerattached) {
if (playerdir==1 && playerx<=x-0.5 ||
playerdir==3 && playerx>=x+11.5)
detachplayer;
} else if (playery in |y+1,y+4|) {
if (playerdir==3 && playerx==x-2.5 ||
playerdir==1 && playerx==x+13.5)
attachplayertoobj 0,npcs[0].id;
}
timereverywhere;
timeout = 0.05;
}
I haven't tested this yet on the NPC Server, so I am not sure whether the attachplayertoobj can be clientside.
The script is working fine, but when you are leaving the bridge, the player is suddenly under it. I have no clue how to improve it except by adding transparent parts at the sides of the bridge.
|