Thread: rounding plz?
View Single Post
  #9  
Old 05-23-2007, 11:31 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by theHAWKER View Post
I have made a shop where you can buy axe's and go chop some trees down.
then you can come back and sell your wood for a random amount of the day(well not exactly)

here is my script:
PHP Code:
function onPlayerEnters(){
this.num random(3,20);
}
function 
onPlayerChats(){
if (
player.chat == "/buy axe"){
if (
player.rupees >= 500){
player.rupees -= 500;
addweapon(Axe);
player.chat "I got an Axe!";
}
if (
player.rupees 500){
player.chat "I need more rupees for that axe!";
}
}
if (
player.chat == "/sell wood"){
clientr.woods -= 5;
player.rupees += this.num;
player.chat "I sold 5 wood for "@this.num@" bucks!";
}

there is nothing wrong with it, i just dont want it to say:
I sold 5 wood for 13.457252421932 bucks!
cause thats just redonculous(re-donk-u-lus )
Round of applause theHAWKER!

Looks like you're learning GS2, good job!

One thing I would like to point out however.
You used
PHP Code:
addWeapon(Axe); 
what you should use is
PHP Code:
addWeapon("Axe"); 
that way it is not trying to add whatever is in the variable 'Axe', which is most likely NULL.
__________________
Reply With Quote