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

Dangerous Teleporter Script

A Config Script for Baldi's Basics

No ads for members. Membership is 100% free. Sign up!
34 1 kb Raw Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using UnityEngine;
using System.Collections;

private IEnumerator Teleporter()
    {
        this.playerCollider.enabled = false;
        int teleports = UnityEngine.Random.Range(7, 14);
        int teleportCount = 0;
        float baseTime = 0.3f;
        float currentTime = baseTime;
        float increaseFactor = 1.1f;
        while (teleportCount < teleports)
        {
            currentTime -= Time.deltaTime;
            if (currentTime < 0f)
            {
                this.Teleport();
                teleportCount++;
                baseTime *= increaseFactor;
                currentTime = baseTime;
            }
            this.player.height = 4f;
            yield return null;
        }
        this.playerCollider.enabled = true;
        yield break;
    }

private void Teleport()
    {
        this.AILocationSelector.GetNewTarget();
        this.player.transform.position = this.AILocationSelector.transform.position + Vector3.up * this.player.height;
        this.audioDevice.PlayOneShot(this.aud_Teleport);
    }

Enjoy this code!

This is a script I made for dangerous teleporter to get it working in a mod. Also, I noticed not many have put scripts here, so enjoy looking at the code! If you decide to use this, put the code in gamecontroller script.
Sign up to access this!
  • ToffeeRecord avatar
    ToffeeRecord Joined 1y ago
    Slacking/Busy
    462 points Ranked 46805th
    7 medals 1 rare
    • Returned 1000 times Medal icon
    • Returned 100 times Medal icon
    • One month a member Medal icon
    • Submitted 5 Gamefiles Medal icon
    • 6 months a member Medal icon
    • 1 post awarded Exemplary Feedback Medal icon
    access_time 4d
    Error CS0246: The type or namespace name 'IEnumerator' could not be found
    Mediocre Game Developer/Modder avatar
    Mantra
    Mediocre Game Developer/Modder
    URL to post:
  • 04rascal avatar
    04rascal username pic Joined 6y ago
    addmetoBuddies
    1,137 points Ranked 23563rd
    10 medals 1 rare
    • Returned 1000 times Medal icon
    • One month a member Medal icon
    • 6 months a member Medal icon
    • 1 year a member Medal icon
    • 2 years a member Medal icon
    • Returned 100 times Medal icon
    access_time 4d
    It Say: Syntax error, ',' expected

    How To Fix It.. HELP PLZ
    . avatar
    Mantra
    .
    URL to post:

Embed

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

Credits

Key Authors
JohnsterSpaceProgram Johnster Space Studio Flag
Affiliation
Johnster Space Studio
Offline
3,185 points Ranked 2899th
26 medals 2 legendary 4 rare
  • 2019 Top Contributor Medal icon
  • Returned 5000 times Medal icon
  • Returned 1000 times Medal icon
  • 10 submissions featured Medal icon
  • Reached 50 subscribers Medal icon
  • Received thanks 50 times Medal icon
Made The Script
Special Thanks
Basically, Games!
Made Baldi's Basics, Teleporter Item

Submitter

Online Learning
3,185 points Ranked 2899th
26 medals 2 legendary 4 rare
  • 2019 Top Contributor Medal icon
  • Returned 5000 times Medal icon
  • Returned 1000 times Medal icon
  • 10 submissions featured Medal icon
  • Reached 50 subscribers Medal icon
  • Received thanks 50 times Medal icon
JohnsterSpaceProgram Johnster Space Studio Flag
Affiliation
Johnster Space Studio

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

Language
Script Replaced
GameControllerScript

Share

  • Share on Reddit
  • Share on Twitter
  • Share on Facebook
  • 4
  • 482
  • 6
  • 2mo
  • 4d

WiPs by Submitter

More Other/Misc Scripts