PDA

View Full Version : random numbers?


mYg0tHaMpStEr
11-27-2006, 02:42 AM
I'm making something as a prize, and what ever number a person gets determines what prize they get. I need a random number here. This is what I got.
But it doesn't give a random number, I need a random number! >:{

//#CLIENTSIDE
function onCreated()
{
}
function onPlayerTouchsMe()
{
message("8");
sleep(3);
}

fowlplay4
11-27-2006, 03:13 AM
ummm how bout this..

//#CLIENTSIDE
function onCreated() {
this.num = random(0,9999);
this.chat = "Enjoy your random number!" SPC this.num;
}

Gambet
11-27-2006, 03:35 AM
Might want to make that


this.num = int(random(0,9999));


Unless you want decimals....

Mark Sir Link
11-27-2006, 05:32 AM
Might want to make that


this.num = int(random(0,9999));


Unless you want decimals....

I was pretty sure Graal's random function would always return an int anyway?

Gambet
11-27-2006, 05:59 AM
I was pretty sure Graal's random function would always return an int anyway?


You thought wrong. >_<

mYg0tHaMpStEr
11-27-2006, 05:17 PM
Joey AIM'ed me last night, gave me a great script, thanks to all that helped. :D

Mods may close/delete this thread.

-Ork