Thread: rounding plz?
View Single Post
  #10  
Old 05-23-2007, 11:40 PM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
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 )
Eh, I just learned int too :o
Make "this.num = random(3,20);" into "this.num = int(random(3,20));" and all should be fine...
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote