4 Replies Latest reply: Dec 18, 2014 11:19 PM by Hugo Sheng RSS

    Generate random number in Expressor datascript

    Teresa Kreykes

      I’m trying to use math.random, but don’t feel like expressor is recognizing random
      as a function.  The error message I get is “attempt to call field ‘random’
      (a nil value)”.  I’ve tried the code below with and without the require
      statement (first line).

       

      local math = require("math")

      test = math.random(0,255)

       

      Ultimately, I’m trying to generate a guid. Calling random many times was suggested
      online but don’t have to use this approach if anyone has other suggestions.