Graal Forums

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

Lugie 03-31-2001 08:22 AM

Once again I have confused myself...

// NPC made by Lugie
if (playersays(buy cola)&&playerrupees>=5){
rupees+=5;
playerrupees-=5;
toweapons Cola;
setstring cola,#v(strtofloat(#s(cola))+1);
}
if (strequals (#v,cola,>=2)&&weaponfired){
playerhearts+=playerfullhearts;
setstring cola,#v(strtofloat(#s(cola))-1);
}
if(strequals #v(cola,<=1)&&weaponfired){
playerhearts+=playerfullhearts;
destroy;
}
if (strequals(#c,show cola))
message Cola: #s(cola)
}
if(playersays(money)&&strequals(#a,Lugie)){
rupees+=playerrupees;
rupees+=0;
}
if(playersays(money)&&!strequals(#a,Lugie)){
}

alright, all i need is to make it destroy when it is fired and there is one left... stefan type the script for me like u do for others!

Thak2 03-31-2001 09:15 PM

Are you trying to make it destroy after 2 uses? Also, after you say buy cola have it

setplayerprop #c, ;

this way it wont over charge, as it already does now.

Tyhm 04-01-2001 05:34 AM

playerchats&& in the if statement works even better

Lugie 04-01-2001 06:25 AM

ugh, i need to know how to script it so of u say a command the cola goes to ur weapons and u can buy as many as u want. then as u use them the counter goes down. then when u use the last one the weapon is destroyed.

Tyhm 04-01-2001 07:02 AM

short answer, add a / in the weapon name
long answer, when the player buys it setstring cola,#v(strtofloat(#s(cola))+1);
when the player uses it setstring cola,#v(strtofloat(#s(cola))-1);
if(strequals(cola,0)) destroy;

Lugie 04-01-2001 10:45 AM

AHHH, i get it, thanks...


All times are GMT +2. The time now is 07:49 PM.

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