Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Attach? (https://forums.graalonline.com/forums/showthread.php?t=21923)

lordhelmut 01-24-2002 10:09 AM

Attach?
 
I saw on 2001 those NPCs that are like elevators. They are on the sides of the mountains and stuff and you step on them and it carrys you up. I know this must use attachplayertoobj pr whatever but is there anyway to do this on a free server?

TDK_RC6 01-24-2002 10:32 AM

NPC Code:

if (playertouchsme) {
disabledefmovement;
attachplayertoobj 0,npcs[0].id;
for (i=y; i<desiredy; i++) {
y+=whateveramount; }
}
if (y==desiredamount) {
detachplayerl }
}



this is a rough script
[/code]

lordhelmut 01-24-2002 10:37 AM

isnt that only allowed for p2p though?

TDK_RC6 01-24-2002 11:01 AM

i believe so, im not sure

lordhelmut 01-24-2002 11:24 PM

dammit

TDO2000 01-24-2002 11:34 PM

NPC Code:

if(playerenters){
timereverywhere;
drawunderplayer;
this.y={5,15}; // {starty,endy}
//getdir to know if it goes first up or down
if(this.y[0] > this.y[1]){this.dir={0,2};}
else {this.dir={2,0};}
this.speed=.5; //speed elevator is moving
this.active=0;
if(isleader){y=this.y[0];}
}

if(playertouchsme){
setani idle,; //Normally u can see the walking gani
this.active=1;
timeout=.05;
}

if(timeout){
if(this.active > 0){
//only if using it
if(this.active==1){
freezeplayer .05;
playerx=x+(width/2-1.5);
playery=y+(height/2-2);
}
moving();
timeout=.05;
}
}

function moving() {
if(this.active==1){
if(abs(this.y[1]-y) > 0){y+=vecy(this.dir[0])*this.speed;}
else {this.active=2;}
}

if(this.active==2){
if(abs(this.y[0]-y) > 0){y+=vecy(this.dir[1])*this.speed;}
else {this.active=0;}
}
}



should be easy to edit it ^_^

lordhelmut 01-25-2002 12:39 AM

THAT KICKS ASS!


All times are GMT +2. The time now is 08:46 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.