PDA

View Full Version : Counter


Lugie
03-31-2001, 09: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, 10: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, 06:34 AM
playerchats&& in the if statement works even better

Lugie
04-01-2001, 07: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, 08: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, 11:45 AM
AHHH, i get it, thanks...