Jump to content

Number Random Script Lua?


Yue
 Share

Go to solution Solved by macklebee,

Recommended Posts

  • Solution

with inherent lua:

http://www.lua.org/manual/5.1/manual.html#5.6

math.randomseed(Time:Millisecs()) 
myvariable = math.random(min,max)

with LE functions:

https://www.leadwerks.com/learn?page=API-Reference_Object_Math_Random

Math:SeedRandom(Time:Millisecs())
myvariable = Math:Random(min,max)

In both cases, you need to set the minimum and maximum values (min & max) that the random number should be equal to or fall between.

 

Just FYI - there is a search available in the upper right-hand corner of the forum that can allow you to search for stuff like this :

search.jpg.8e3e0a4118cd445aa2637dd10534d6c7.jpg

  • Haha 1
  • Upvote 1

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...