View Single Post
  #8  
Old 09-21-2001, 11:44 PM
CyanideSR71 CyanideSR71 is offline
Registered User
CyanideSR71's Avatar
Join Date: Jun 2001
Location: Canada
Posts: 460
CyanideSR71 is on a distinguished road
Quote:
Originally posted by Kaimetsu
Um... The odds of getting 483 from a random(0,1000) are like 100000000000:1. You better have some patient players.
It's fun to tell him why, Kai!

PHP Code:
this.destroy=int(random(1,1000)); 
if (
this.destroyed=483) { 
putnpc diamond.gif,diamond.txt,32,32

By using random, it finds a random real number between the two numbers you've set. That means that muber could be 4.876658756 or any other number like that, making the odds of getting 483 somewhere around infinity to one. What you want is a random integer number, which only allows numbers without decimals. By putting int() in there, the odds around 1 in 1000 once again.
__________________
Cyanide SR71
Former Shadow Dragon
Co-Owner of what was Murasamune
Reply With Quote