Ads keep us online. Without them, we wouldn't exist. We don't have paywalls or sell mods - we never will. But every month we have large bills and running ads is our only way to cover them. Please consider unblocking us. Thank you from GameBanana <3

How I Can Make Random Events For My Decompile

A Question for Baldi's Basics in Education and Learning

Members see zero ads. Membership is 100% free

How I Can Make Random Events For My Decompile

Random Events
1-The Fog
2-Principal's Office Party (Without Balloons)

I want an explanation with many details

Answers

Sign up to access this!
  • RealT5mpler avatar
    RealT5mpler Joined 5mo ago
    Not on right ok
    953 points Ranked 41063rd
    9 medals 1 rare
    • Returned 1000 times Medal icon
    • One month a member Medal icon
    • Returned 100 times Medal icon
    • 1 post awarded Exemplary Feedback Medal icon
    • 5 posts awarded Exemplary Feedback Medal icon
    • 10 posts awarded Exemplary Feedback Medal icon
    access_time 23d edit 23d
    This is what I will say

    1. Make 2 variables (Btw also add a new Script like "EventScript)

    the first variable will be the wait time for the event to start

    the second variable will be a float to determine what the event will be (for example if (variable == 1 then do the fog event)
    Now next thing

    2. Make a start method (public void Start() ) and then
    make this code 

    "(your 1st variable) = UnityEngine.Random.Range( (the minimum amount of time for the event to start), (the maximum amount of time for the event to start) );"

    an example of this is
    this.waittime = UnityEngine.Random.Range(100, 300);
    your waittime doesn't need to be random but I recommend it for diversity. OH YEAH before you do that 2.5 - At the very top of the script copy this "using UnityEngine;"

    3. Now make a Update Method ( public void Update() ) 
    and then copy this

    "if (  this. (your 1st variable) ) > 0  )
    {
    this. (your 1st variable) -= 1 * time.DeltaTime;
    }

    This is code is basically, it wait 1 second and minuses 1 for the variable, It's like time in a way

    now after this paste this after a new line of code after that

    else
    {
    this. (your 2nd variable) = UnityEngine.Random.Range(0f, (the amount of events you want - 1) );
    }

    4. Now paste this code after that
    if (this.(your 2nd variable) == 0f)
    {
    (Put The code for your first event here)
    }
    else if (this.(your 2nd variable) == 1f)
    {
    (Put the code for your second event here)
    }
    The amount of if statements depends on how many events you want

    • Agree x 1
    • Win x 1
    • Helpful x 1
    • Interesting x 1
    • Thanks x 1
    • Creative x 1
    Never Give up on what you want avatar
    Mantra
    Never Give up on what you want
    URL to post:

Embed

menu
Share banner
Image URL
HTML embed code
BB embed code
Markdown embed code

Announcement

--> Davi 3D Studio <-- - Mundodavi2

Asker

Mundodavi2 avatar
Mundodavi2 Joined 9mo ago
*Error*
Davi 3D Studio Flag Affiliation: Davi 3D Studio
66 points Ranked 62209th
Mundodavi2 Davi 3D Studio Flag
Affiliation
Davi 3D Studio

Sign up to access this!
Sign up to access this!
Sign up to access this!

Game

Sign up to access this!

Category

Share

  • Share on Reddit
  • Share on Twitter
  • Share on Facebook
  • favorite 1
  • remove_red_eye 405
  • mode_comment 2
  • access_time 24d
  • access_time 23d

More from Submitter

menu

WiPs by Submitter

menu

More Decompile Help Questions