Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › MultiPlayer Game Hacks & Cheats › Steam Games Hacks & Cheats › Garry's Mod Hacks & Cheats › Garry's Mod Coding & Resources › LUA math.random algorithm

LUA math.random algorithm

Posts 1–3 of 3 · Page 1 of 1
MO
mobman11111
LUA math.random algorithm
Currently, I'm working on a way to predict Nutscript and Clockwork's rolling system so that people can get perfect rolls each go, however one thing I haven't been able to find is the source code for math.random in Lua, if I'm correct the default randomseed is os.time(). If anyone could drop it for me, you'd be doin' me a massive favour.
#1 · 8y ago
MO
mobman11111
I'm also going to ask, what is the default seed Lua uses?
#2 · 8y ago
Gorzoid
Gorzoid
https://******.com/LuaDist/lua/blob/...ib.c#L181-L206

It is dependent on the C++ compiler used.
The lua manual:
This function is an interface to the simple pseudo-random generator function rand provided by ANSI C. (No guarantees can be given for its statistical properties.)
Edit: I have heard that the default seed is 1 but I can't find any official source so it might depend on implementation aswell.

Edit 2: https://linux.die.net/man/3/rand
If no seed value is provided, the rand() function is automatically seeded with a value of 1.
#3 · edited 8y ago · 8y ago
Posts 1–3 of 3 · Page 1 of 1

Post a Reply

Similar Threads

  • So I stole some luas from random servs...By Sakimoto in Garry's Mod Discussions & Help
    2Last post 10y ago
  • How do i make something rotate in a circle using lua, What math.powers would i need?By suchisgood in Garry's Mod Discussions & Help
    7Last post 11y ago
  • Line of code to make my Lua menu change colors randomlyBy ronaldmc123 in Garry's Mod Coding & Resources
    4Last post 10y ago
  • Shoot randomly then kill .lua script??By Zekiheil in Garry's Mod Discussions & Help
    4Last post 10y ago
  • Help with using math(algorithm) in C++ programming and Raptor(flowchart) (pay 10$)By Bryan in Work & Job Offers
    2Last post 10y ago

Tags for this Thread

None