Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
Randomly generate a variable

spicymilk
Registered User
Quote
2023-08-02 20:52:25

Is it possible to have a script randomly generate a variable within a given range?

Thanks,


Guest
Guest
Quote
2023-08-02 21:31:33

Yeah you can do all sorts of random stuff.

var roll = Math.floor(Math.random() * 6);

var dir = ["up", "down", "left", "right", "front", "back"];

var result = dir[roll];

print(result);

Etc, etc.

Read this:

https://www.w3schools.com/js/def...


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internation?l" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact