GameBanana shows no ads to members. Sign up now!
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 to add Item Hotkeys to PD, KED 1.2, or CD Mods

A Tutorial for Baldi's Basics

1. Load up Assembly-CSharp in dnSpy
2. Find "ItemManager"
3. Open the edit window
4. Replace the update void with this: 
private void Update()
    {
        if (Time.timeScale != 0f)
        {
            if (this.reInput.GetAxis("ItemSelect") > 0f || this.reInput.GetButtonDown("ItemRight"))
            {
                this.IncreaseItemSelection();
            }
            else if (this.reInput.GetAxis("ItemSelect") < 0f || this.reInput.GetButtonDown("ItemLeft"))
            {
                this.DecreaseItemSelection();
            }
            else if (Input.GetKeyDown(KeyCode.Alpha1) || Input.GetKeyDown(KeyCode.Keypad1))
            {
                this.selectedItem = 0;
                this.UpdateSelect();
            }
            else if (Input.GetKeyDown(KeyCode.Alpha2) || Input.GetKeyDown(KeyCode.Keypad2))
            {
                this.selectedItem = 1;
                this.UpdateSelect();
            }
            else if (Input.GetKeyDown(KeyCode.Alpha3) || Input.GetKeyDown(KeyCode.Keypad3))
            {
                this.selectedItem = 2;
                this.UpdateSelect();
            }
            else if (Input.GetKeyDown(KeyCode.Alpha4) || Input.GetKeyDown(KeyCode.Keypad4))
            {
                this.selectedItem = 3;
                this.UpdateSelect();
            }
            else if (Input.GetKeyDown(KeyCode.Alpha5) || Input.GetKeyDown(KeyCode.Keypad5))
            {
                this.selectedItem = 4;
                this.UpdateSelect();
            }
            if (this.reInput.GetButtonDown("UseItem"))
            {
                this.UseItem();
            }
        }
    }


5. Press the Compile button
6. Press the "Save All" button in the top bar (Looks like two floppy disks)
And you are done! Simple, huh? Thanks to LuisRandomness for the code!
Edit: Make sure to credit me for the tutorial and LuisRandomness for the code! Thanks!
Sign up to access this!

Embed

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

Announcement

why am i so stupid - CyndaquilDAC

Studio

Sign up to access this!

Credits

Key Authors
CyndaquilDAC avatar CyndaquilDAC Productions Flag
Affiliation
CyndaquilDAC Productions
CyndaquilDAC username pic Joined 2y ago
Offline
-32 points Ranked 54505th
17 medals 1 legendary 2 rare
  • Became a Ripe Supporter Medal icon
  • Returned 1000 times Medal icon
  • Submitted 20 Gamefiles Medal icon
  • One month a member Medal icon
  • 6 months a member Medal icon
  • 1 year a member Medal icon
Tutorial
LuisRandomness avatar Ruler Productions Flag
Affiliation
Ruler Productions
LuisRandomness username pic Joined 2y ago
Ripe Supporter Baldi Manager
Offline
Ruler Productions Flag Affiliation: Ruler Productions
2,249 points Ranked 20531st
21 medals 1 legendary 3 rare
  • Became a Ripe Supporter Medal icon
  • Achieved Game Manager clearance Medal icon
  • Returned 1000 times Medal icon
  • Reached 50 subscribers Medal icon
  • One month a member Medal icon
  • Submission featured Medal icon
Code

Submitter

CyndaquilDAC username pic Joined 2y ago
Off The Banana
-32 points Ranked 54505th
17 medals 1 legendary 2 rare
  • Became a Ripe Supporter Medal icon
  • Returned 1000 times Medal icon
  • Submitted 20 Gamefiles Medal icon
  • One month a member Medal icon
  • 6 months a member Medal icon
  • 1 year a member Medal icon
CyndaquilDAC avatar
CyndaquilDAC
CyndaquilDAC Productions Flag
Affiliation
CyndaquilDAC Productions

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

Game

Sign up to access this!

Category

Details

Difficulty Level
Beginner

Attributes

Share

  • Share on Reddit
  • Share on Twitter
  • Share on Facebook
  • 1
  • 416
  • 1
  • 13d
  • 9d

More from Submitter

WiPs by Submitter

WiPs by Studio

More Scripting Tutorials