Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Help With NPC! (https://forums.graalonline.com/forums/showthread.php?t=15192)

MattPlug 10-22-2001 10:25 AM

Help With NPC!
 
How can I make it where when the player dies it warps that person somewhere....I've tried
if (playerdied) {
setlevel2 blah.graal,30,30;
}

and

if (playerdies) {
setlevel2 blah.graal,30,30;
}

I've made sure I had the lvl name right and all. How can I get this to work? Do I have the right one or what? Also does any one know if showimg with the index of 202 is private like so no one else can see?

aesquivel 10-22-2001 10:35 AM

if (playerdies) {
setlevel2 blah.graal,x,y;
}

if that doesnt werk then i dunno whats wrong but i do know thats right :)

royce 10-22-2001 11:11 AM

dang u must be a suckii scripter

aesquivel 10-22-2001 11:23 AM

Quote:

Originally posted by royce
dang u must be a suckii scripter
who are u talking ta?

royce 10-22-2001 11:26 AM

the question is who am i talking about and dont worry its not you;) ;)

royce 10-22-2001 11:27 AM

its about matt plug

aesquivel 10-22-2001 11:39 AM

:D Goodie

Shard_IceFire 10-22-2001 08:33 PM

The correct thing to use if a player dies is:
NPC Code:

if (playerdies) {
//stuff here
}


TDO2000 10-22-2001 09:20 PM

I think that can't work because u respawn somewhere else ;)

aesquivel 10-23-2001 12:24 AM

ya it does depend on the way the server is set and ummm Shard_IceFire read above i though we alerady figured that out

btedji 10-23-2001 03:20 AM

YOU CANT WARP WHEN YOU ARE DEAD OR IN DEAD MODE!

MattPlug 10-23-2001 11:20 AM

What about when player has 0 hearts it warps? How would I do that?
if (playerhearts>=0) {
setlevel2 blah.graal,30,30;
}

grim_squeaker_x 10-23-2001 05:40 PM

Just make sure that the level the player get's warped to is a sparring zone, those reset your respawn point.

Python523 10-24-2001 05:57 AM

Since you can't warp when you're dead, can't you try this?

if (playerdies) {timeout=3;}
if (timeout) {setlevel2 blah.graal,30,30;}

aesquivel 10-24-2001 07:38 AM

Quote:

Originally posted by MattPlug
What about when player has 0 hearts it warps? How would I do that?
if (playerhearts>=0) {
setlevel2 blah.graal,30,30;
}

NPC Code:

if (playerhearts=0) {
setlevel2 blah.graal,30,30;
}



dats a little better cuz u dont need the > im not saying it'll werk but it makes it more right if that sounds right

TDO2000 10-24-2001 08:04 AM

um if u have 0 hearts u are dead even if u warp somewhere if it's not a sparring zone u will respwan somewhere else...

PresShinP2P 10-24-2001 10:27 PM

if (playerdies){
timeout=.05;
}
if (timeout){
if (playerhearts>0){
setlevel2 mylevel,30,30;
}else{timeout=.05}
}

touch`e
try that

Poogle 10-24-2001 10:36 PM

Ive tried to warp a dead player it does work then it warps them to anther level why is this?

LiquidIce00 10-24-2001 11:31 PM

if the thing where you warp to a sparring zone doesnt work then

you can try this (not tested.. just made it up)

if (playerdies) {
setstring deadlevel,#L;
setstring deadx,#v(playerx);
setstring deady,#v(playery);
}
if (playerenters) {
this.x=strtofloat(#s(deadx));
this.y=strtofloat(#s(deady));
if (this.x>-1 && this.y>-1) {
setlevel2 #s(deadlevel),playerx,playery;
}
else {
setstring deadlevel,;
setstring deadx,-1;
setstring deady,-1;
}
}


All times are GMT +2. The time now is 06:34 AM.

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