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!

Embed

Transzparens megosztása
Kép URL
HTML kód beágyazás
Formázás beágyazása
Markdown kód beágyazás

Credits

Key Authors
JohnsterSpaceProgram Johnster Space Studio Flag
Affiliation
Johnster Space Studio
Offline
3,745 points Ranked 2163rd
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,745 points Ranked 2163rd
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
  • 517
  • 6
  • 2mo
  • 8d

WiPs by Submitter

More Other/Misc Scripts