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

Item Pickup Scrambler

A Config Script for Baldi's Basics in Education and Learning

Members see zero ads. Membership is 100% free
1/ 115   Truncated 4 kb Raw Code
1
using System;
using Rewired;
using UnityEngine;

// Token: 0x020000EE RID: 238
public class PickupScript : MonoBehaviour
{
    // Token: 0x06000A47 RID: 2631
    public PickupScript()
    {
    }

    // Token: 0x06000A48 RID: 2632
    private void Start()
    {
        this.playerInput = ReInput.players.GetPlayer(0);
        this.chosen = Mathf.RoundToInt(UnityEngine.Random.Range(1f, (float)this.gc.itemTextures.Length - 1f));
        this.objectTexture = base.GetComponentInChildren();
        this.texture = this.gc.itemTextures[this.chosen];
        this.texture.filterMode = FilterMode.Point;
        this.objectTexture.sprite = Sprite.Create((Texture2D)this.texture, new Rect(0f, 0f, (float)this.texture.width, (float)this.texture.height), new Vector2(0.5f, 0.5f));
    }

    // Token: 0x06000A49 RID: 2633
    private void Update()
    {
        RaycastHit raycastHit;
        if (this.playerInput.GetButtonDown("Interact") && Time.timeScale != 0f && Physics.Raycast(Camera.main.ScreenPointToRay(new Vector3((float)(Screen.width / 2), (float)(Screen.height / 2), 0f)), out raycastHit))
        {
            if (raycastHit.transform.name == "Pickup_EnergyFlavoredZestyBar" & Vector3.Distance(this.player.position, base.transform.position) < 10f)
            {
                raycastHit.transform.gameObject.SetActive(false);
                this.gc.CollectItem(this.chosen);
                return;
            }
            if (raycastHit.transform.name == "Pickup_YellowDoorLock" & Vector3.Distance(this.player.position, base.transform.position) < 10f)
            {
                raycastHit.transform.gameObject.SetActive(false);
                this.gc.CollectItem(this.chosen);
                return;
            }
            if (raycastHit.transform.name == "Pickup_Key" & Vector3.Distance(this.player.position, base.transform.position) < 10f)
            {
                raycastHit.transform.gameObject.SetActive(false);
                this.gc.CollectItem(this.chosen);
                return;
            }
            if (raycastHit.transform.name == "Pickup_BSODA" & Vector3.Distance(this.player.position, base.transform.position) < 10f)
            {
                raycastHit.transform.gameObject.SetActive(false);
                this.gc.CollectItem(this.chosen);
                return;
            }
            if (raycastHit.transform.name == "Pickup_Quarter" & Vector3.Distance(this.player.position, base.transform.position) < 10f)
            {
                raycastHit.transform.gameObject.SetActive(false);
                this.gc.CollectItem(this.chosen);
                return;
            }
            if (raycastHit.transform.name == "Pickup_Tape" & Vector3.Distance(this.player.position, base.transform.position) < 10f)
            {
                raycastHit.transform.gameObject.SetActive(false);
                this.gc.CollectItem(this.chosen);
                return;
            }
            if (raycastHit.transform.name == "Pickup_AlarmClock" & Vector3.Distance(this.player.position, base.transform.position) < 10f)
            {
                raycastHit.transform.gameObject.SetActive(false);
                this.gc.CollectItem(this.chosen);
                return;
            }
            if (raycastHit.transform.name == "Pickup_WD-3D" & Vector3.Distance(this.player.position, base.transform.position) < 10f)
            {
                raycastHit.transform.gameObject.SetActive(false);
                this.gc.CollectItem(this.chosen);
                return;
            }
            if (raycastHit.transform.name == "Pickup_SafetyScissors" & Vector3.Distance(this.player.position, base.transform.position) < 10f)
            {
                raycastHit.transform.gameObject.SetActive(false);
                this.gc.CollectItem(this.chosen);
                return;
            }
            if (raycastHit.transform.name == "Pickup_BigBoots" & Vector3.Distance(this.player.position, base.transform.position) < 10f)
            {
                raycastHit.transform.gameObject.SetActive(false);
                this.gc.CollectItem(this.chosen);
            }
        }
    }

    // Token: 0x04000756 RID: 1878
    public GameControllerScript gc;

    // Token: 0x04000757 RID: 1879
    public Transform player;

    // Token: 0x04000758 RID: 1880
    private Player playerInput;

    // Token: 0x04000759 RID: 1881
    public AILocationSelectorScript wanderer;

    // Token: 0x0400075A RID: 1882
    public Transform wanderTarget;

    // Token: 0x040007CF RID: 1999
    private Texture texture;

    // Token: 0x040007D0 RID: 2000
    private SpriteRenderer objectTexture;

    // Token: 0x040007D8 RID: 2008
    private int chosen;
}

A script that you can apply where the items won't be the same!

Item Pickup Scrambler is a script for Baldi's Basics Classic where obviously, all item pickups will have random contents in them, or in other words, they will be different items for each time you start the game. It's like the presents in Birthday Bash and the random/fake item pickups from other mods such as Baldi's Basics and A Bunch of New Items by MissingTextureMan101, but they aren't random by when you collect them, but instead it will be determined on what item they will be.

Install Instructions

You will require, even though you would probably already have these:

Now go to your copy of the game, go to "PREFIX_Data" (PREFIX can often be "BALDI", "PARTY", the mod's name, etc.), then go to Managed, and you will have to find the "Assembly-CSharp.dll" file.

Open "Assembly-CSharp.dll" with dnSpy (you can do this in Windows Explorer or in dnSpy itself), and then in dnSpy, expand via clicking the arrow in the left of the file's name, then do it again.
When you see "PE", "References", "-", "MaterialKit", etc., click on "-", and it will show all of the scripts used in-game.

Find "PickupScript" and right click on it, and click "Edit Class" on the context menu. You will now need to select everything shown in the window, and then go back to this page to copy the code and then paste it replacing the original code. After you have done that, click on "Compile", and then go to "File", then click either "Save Module" or "Save All", then click "OK". You can now close dnSpy.

Now run the game and there you go.

Requirements

Dependencies and prerequisites required to use this Script

Todos

menu
check_box_outline_blank Make the script compatible with 1.3.2 and lower as well as decompiles such as OSB.

Comments

Sign up to access this!

Embed

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

Announcement

If you are in one of my Baldi mod submissions… I might port some of the mods I’ve already made to 1.4.3, but not all. Some might keep into their respective version for important reasons. Thank you.

- LuisRandomness

Credits

Key Authors
LuisRandomness avatar Ruler Productions Flag
Affiliation
Ruler Productions
LuisRandomness username pic Joined 1y ago
Baldi Manager
Online
?
Ruler Productions Flag Affiliation: Ruler Productions
522 points Ranked 45176th
15 medals 2 rare
  • Achieved Game Manager clearance Medal icon
  • Returned 1000 times Medal icon
  • One month a member Medal icon
  • Submission featured Medal icon
  • Returned 100 times Medal icon
  • Reached 10 subscribers Medal icon
Creator of the script.
Micah McGonigal (mystman12)
Original PickupScript code.
0xd4d
Developer of dnSpy.
Fasguy avatar 30Hz Studios Flag
Affiliation
30Hz Studios
Fasguy username pic Joined 1y ago
Offline
30Hz Studios Flag Affiliation: 30Hz Studios
2,380 points Ranked 20249th
12 medals 2 rare
  • Reached 50 subscribers Medal icon
  • Returned 1000 times Medal icon
  • Returned 100 times Medal icon
  • One month a member Medal icon
  • Reached 10 subscribers Medal icon
  • 6 months a member Medal icon
Code to make objects have a texture given via base64, but modified to use the item textures instead of a new base64 one.

Submitter

LuisRandomness avatar
LuisRandomness username pic Joined 1y ago
Baldi Manager
nowAvailable
?
Ruler Productions Flag Affiliation: Ruler Productions
522 points Ranked 45176th
15 medals 2 rare
  • Achieved Game Manager clearance Medal icon
  • Returned 1000 times Medal icon
  • One month a member Medal icon
  • Submission featured Medal icon
  • Returned 100 times Medal icon
  • Reached 10 subscribers Medal icon
LuisRandomness avatar
LuisRandomness
Ruler Productions Flag
Affiliation
Ruler Productions

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

Game

Sign up to access this!

Category

License

menu

Attributes

Language
C#
Script Replaced
PickupScript

Share

  • Share on Reddit
  • Share on Twitter
  • Share on Facebook
  • favorite 3
  • remove_red_eye 454
  • mode_comment 2
  • access_time 1mo
  • access_time 1mo

WiPs by Submitter

menu