View Single Post
  #24  
Old 12-23-2012, 01:34 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by BboyEatsbacon View Post
You all are making it so complex, but with GS2, you can tackle this problem simply.

PHP Code:
function onCreated() {
  
this.possibilities = { "5""10" };

  
drawRandomNumber();
}

function 
drawRandomNumber() {
  
this.number randomstring(this.possibilities);

While this is not good practice for other engines, GS2 supports inputting a string as an integer, so this script would work smoothly.
randomString() is not a good option. It's been bugged for a long time, and sometimes results in a blank result. With sometimes, I really mean fairly often.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote