Jump to content

BattleRoll

From CMM Wiki
Return to CMM Command Reference
Environment: Mission Scripting
Function: BattleRoll
Function Description: Determines if a battle roll is successful based on a given probability between 0 and 1, where a value of 0.8 means there is an 80% chance of success.
File Location: cmm.mathsFunctions.lua
Syntax: CMM.BattleRoll( number number )
Return Value: boolean
Parameters: Name Description
numberProbability value between 0 and 1, representing the success threshold; for example, 0.8 means the roll succeeds if a random number is less than or equal to 80.
Example: CMM.BattleRoll(0.7)
Example Description: Returns true if a random number between 0 and 100 is less than or equal to 70, indicating a 70% chance of success.
Related Functions:
Notes: