Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #19  
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
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 03:07 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.