Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Help in a Script ^^ (Putnpc2) (https://forums.graalonline.com/forums/showthread.php?t=43220)

TheStivi 03-04-2003 03:55 PM

Help in a Script ^^ (Putnpc2)
 
This the part of the new Trophy Sys for G2k2 and for Doomsday ^^ maybe not for g2k2 but for doomsday , h3h3

Why it dont works ? All works without the dropping of the npc -_-"


There is no image or the npc is not dropped -_-"

Plz help me :

if (strequals(#t(this.test),1) && keydown2(keycode(w),true)){
setani lay,;
setstring server.pos,#v(this.select);
setstring server.name,#s(client.trophies1);
setstring server.rank,#s(client.rank);
putnpc2 playerx+0.5+vecx(playerdir)*2,playery-0.1+vecy(playerdir)*2,{
if (created || playerenters){
setstring this.pos,#s(server.pos);
setstring this.name,#s(server.name);
setstring this.rank,#s(server.rank);
setimg #s(this.rank)#s(this.name)trophy.png;
}
if (playertouchsme){
tokenize #s(client.trophie);
setstring client.trophie;
for (this.i=0;this.i
if (this.i=strtofloat(#s(this.pos))){
setstring client.trophie,#s(client.trophie) 1;
}
else {
setstring client.trophie,#s(client.trophie) #t(this.i);
}
}
destroy;
};

setstring client.trophie,;
for (this.i=0;this.i<60;this.i++){
if (this.i=this.test){
setstring client.trophie,#s(client.trophie) 0;
}
else{
setstring client.trophie,#s(client.trophie) #t(this.i);
}
}
}

tlf288 03-04-2003 03:58 PM

Format it first or I, for one, will not look at it :\

Christian 03-04-2003 04:01 PM

Using server. flags is evil..

TheStivi 03-04-2003 04:03 PM

I hope its formatted good enough -_- :
NPC Code:

if (strequals(#t(this.test),1) && keydown2(keycode(w),true))
{
setani lay,;
setstring server.pos,#v(this.select);
setstring server.name,#s(client.trophies1);
setstring server.rank,#s(client.rank);
putnpc2 playerx+0.5+vecx(playerdir)*2,
playery-0.1+vecy(playerdir)*2,
{
if (created || playerenters){
setstring this.pos,#s(server.pos);
setstring this.name,#s(server.name);
setstring this.rank,#s(server.rank);
setimg #s(this.rank)#s(this.name)trophy.png;
}
if (playertouchsme){
tokenize #s(client.trophie);
setstring client.trophie;
for (this.i=0;this.i<100;this.i++){
if (this.i=strtofloat(#s(this.pos))){
setstring client.trophie,#s(client.trophie) 1;
}
else {
setstring client.trophie,#s(client.trophie) #t(this.i);
}
}
destroy;
};

setstring client.trophie,;
for (this.i=0;this.i<60;this.i++){
if (this.i=this.test){
setstring client.trophie,#s(client.trophie) 0;
}
else{
setstring client.trophie,#s(client.trophie) #t(this.i);
}
}
}


Falados 03-04-2003 10:47 PM

Forgot a } after destroy;
(otherwords, forgot to end the if() statement.)


All times are GMT +2. The time now is 01:41 PM.

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