Thread: Scripting
View Single Post
  #2  
Old 01-15-2002, 04:01 AM
GrowlZP2P GrowlZP2P is offline
Registered User
Join Date: Dec 2001
Location: Corpadverticus, which in case you don't know is the recently-formed and Blockbuster Video-sponsored Tenth Circle of Hell
Posts: 57
GrowlZP2P is on a distinguished road
Send a message via AIM to GrowlZP2P Send a message via Yahoo to GrowlZP2P
Talking

Addstring is fairly easy: it combines two different texts into one string. Try this example:

NPC Code:

if (playerenters) {
addstring b2,lol;
sleep 2;
addstring b2,pie;
sleep 2;
insertstring b2,1,for;
}



Insertstring places a new string in between two other strings. And as for strtofloat:

NPC Code:

if (playerenters){
setimg warpdoorani.gif;
}
if (playertouchsme){
setstring pineapples,#v(strtofloat(#s(pineapples))+1);
if (strtofloat(#s(pineapples))=>4){
say2 You have #s(pineapples) pineapples;
}else{
say2 You don't have enough pineapples;
}
}



Strtofloat changes a string to a number which can be read as a variable instead of a string, and can be changed easily. Hope this helped!
__________________


AIM: GrowlZ1010 | Y! IM: GrowlZ1010 | MSN: [email protected] | Email: [email protected]

- I use obscenely long words to befuddle my adversaries, therefore I am -

Current Favorite Quote: Real programmers don't document. If it was hard to write, it should be hard
to understand.
Reply With Quote