Graal Forums

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

alissalee 10-10-2005 03:30 AM

Hp Script
 
Can some one help me make this hp script be the only thing that shows when u log on and get hit.
NPC Code:
if (actionserverside){
this.player = testplayer(strtofloat(#p(0)),strtofloat(#p(1)));
setstring this.account,#a(#v(this.player));
this.return = 1;
}
//#CLIENTSIDE
if (created||timeout) {
this.test = testplayer(mousex,mousey);
timeout=0.5;
}
if (this.hp != -2 && this.hp != -1){
triggeraction 0,0,serverside,-hp,#v(mousex),#v(mousey);
showtext 1,playerx,playery-1,Arial,b,Hp: 12#s(this.account);
changeimgzoom 1,0.7;
}
if (this.return == 2){
message #s(this.account);
this.return = 0;
}


ZeLpH_MyStiK 10-10-2005 04:56 AM

1. the last two if-statements are made of boolean checks, they aren't event blocks.
2. this.return==2? wtf? how would this EVER equal 2?
3. #a(index) can be done clientside
4. setstring this.account,#a(#v(this.player)); no need to have #v()
5. if this npc worked, it'd show the health of another player (whom you've pointed at with your mouse) over YOUR head, i don't think that what you want.
6. what's this.hp? if you dont set it, it'll return 0
7. wtf in general.

ApothiX 10-10-2005 08:37 AM

You can't access this. serverside variables in the clientside portion of the script o_o to return a variable from serverside, you'd have to trigger serverside, get the variable, then trigger clientside with the variable as a parameter


All times are GMT +2. The time now is 01:17 AM.

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