• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

A percent chance for something to happen

Status
Not open for further replies.
Level 9
Joined
Apr 11, 2008
Messages
515
O hai thair.
So I'm having a problem figuring out making a percent chance for something.
In this case I have 10 levers 1 will free the person they have to free, the other will spawn spiders at him. Now should this be done with a if/then/else or what :eekani: ??
Thanks for reading :p
 
Level 6
Joined
Jul 24, 2008
Messages
180
Make a unit or doodad array variable. In this case, 10. Create an integer variable.

  • Roll
  • Events
    • Unit - A unit is selected
  • Actions
    • Set roll = Random Number between 1 and 10
    • If (All Conditions) Equal to (True) then do (Then Actions) else do (Else Actions)
      • If
        • Selected Unit Equal To lever [roll]
      • Then
        • Free the person
        • Set roll = 0
      • Else
        • Set roll = 0
        • Spawn your spiders
You may need to use something other than 'Unit is selected' because I think that is for a specific unit.
 
Status
Not open for further replies.
Top