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

Working Water Fountain Script

A Config Script for Baldi's Basics

17 421 bytes Raw Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
using UnityEngine;

public class WaterFountainScript : MonoBehaviour
{
        private void Update()
        {
                if (Input.GetMouseButtonDown(0))
                {
                        Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
                        RaycastHit raycastHit;
                        if (Physics.Raycast(ray, out raycastHit, 10f) && raycastHit.collider.name == "Trigger")
                        {
                                PlayerScript.instance.stamina = PlayerScript.instance.maxStamina;
                        }
                }
        }
}
This is a script for the Water Fountain. 

Steps to use

1. In the PlayerScript, make a new variable called public static PlayerScript instance and then in the Awake or Start method, say instance = this;

2. In your water fountain, make sure theres a child gameobject called "Trigger" and that it has a MeshCollider where IsTrigger is on (make the Mesh the Water Fountain)

And yea, credit me if you use this please.
Sign up to access this!

Embed

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

Credits

Key Authors
RealT5mpler avatar
RealT5mpler username pic Joined 1y ago
Not on right ok
1,349 points Ranked 22641st
22 medals 2 legendary 4 rare
  • Returned 5000 times Medal icon
  • Became a Ripe Supporter Medal icon
  • Returned 1000 times Medal icon
  • 25 posts awarded Exemplary Feedback Medal icon
  • Submitted 15 Tutorials Medal icon
  • 50 posts awarded Exemplary Feedback Medal icon
Creator

Submitter

RealT5mpler avatar
RealT5mpler username pic Joined 1y ago
Not on right ok
1,349 points Ranked 22641st
22 medals 2 legendary 4 rare
  • Returned 5000 times Medal icon
  • Became a Ripe Supporter Medal icon
  • Returned 1000 times Medal icon
  • 25 posts awarded Exemplary Feedback Medal icon
  • Submitted 15 Tutorials Medal icon
  • 50 posts awarded Exemplary Feedback Medal icon
RealT5mpler avatar
RealT5mpler

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

Game

Sign up to access this!

Category

License

Attributes

Baldi moddin
C#

Share

  • Share on Reddit
  • Share on Twitter
  • Share on Facebook
  • 0
  • 235
  • 2
  • 8d

More from Submitter

WiPs by Submitter

More Other/Misc Scripts