This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| Ninja = { | |
| Swim = 658832807, | |
| Idle = 658832408, | |
| Jump = 658832070, | |
| Fall = 658831500, | |
| Walk = 658831143, | |
| Run = 658830056, | |
| Climb = 658833139, | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local function gaussianRandom(mean: number, stddev: number): number | |
| -- Box-Muller transform | |
| local u1 = math.random() | |
| local u2 = math.random() | |
| -- z is standard normal (mean 0, stddev 1) | |
| local z = math.sqrt(-2 * math.log(u1)) * math.cos(2 * math.pi * u2) | |
| -- scale + shift | |
| return mean + z * stddev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --!strict | |
| -- pick.luau | |
| math.randomseed(os.clock()) | |
| return function<T>(list: { T }): T | |
| assert(#list > 0, "tried to pick a element from an empty table") | |
| return list[math.random(1, #list)] :: T | |
| end |