table.Random
From GMod Wiki
Function | |
Syntax |
table.Random( Table Table ) Where is this used? |
Description: | |
Returns a random value from the table you give it. | |
Returns: | Random value from specified table |
Part of Library: | Table |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Table.Random]Table.Random [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Description | Tells you how lucky you are today. |
---|---|
Used on | |
Code | local tab = {10, 20, 30, 50, 60, 70, 80, 90, 100} print("Today, I am "..table.Random(tab).."% Lucky!") |
Output | How lucky you are today. |