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

Random JumpRope Script

A Config Script for Baldi's Basics

126 3 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
using System;
using TMPro;
using UnityEngine;

// Token: 0x02000016 RID: 22
public class JumpRopeScript : MonoBehaviour
{
        // Token: 0x0600004D RID: 77
        public JumpRopeScript()
        {
        }

        // Token: 0x0600004E RID: 78
        private void OnEnable()
        {
                this.jumpstodo = Mathf.RoundToInt(UnityEngine.Random.Range(1f, 7f));
                this.jumpDelay = 1f;
                this.ropeHit = true;
                this.jumpStarted = false;
                this.jumps = 0;
                this.jumpCount.text = 0 + "/" + this.jumpstodo.ToString();
                this.cs.jumpHeight = 0f;
                this.playtime.audioDevice.PlayOneShot(this.playtime.aud_ReadyGo);
        }

        // Token: 0x0600004F RID: 79
        private void Update()
        {
                if (this.jumpDelay > 0f)
                {
                        this.jumpDelay -= Time.deltaTime;
                }
                else if (!this.jumpStarted)
                {
                        this.jumpStarted = true;
                        this.ropePosition = 1f;
                        this.rope.SetTrigger("ActivateJumpRope");
                        this.ropeHit = false;
                }
                if (this.ropePosition > 0f)
                {
                        this.ropePosition -= Time.deltaTime;
                        return;
                }
                if (!this.ropeHit)
                {
                        this.RopeHit();
                }
        }

        // Token: 0x06000050 RID: 80
        private void RopeHit()
        {
                this.ropeHit = true;
                if (this.cs.jumpHeight <= 0.2f)
                {
                        this.Fail();
                }
                else
                {
                        this.Success();
                }
                this.jumpStarted = false;
        }

        // Token: 0x06000051 RID: 81
        private void Success()
        {
                this.playtime.audioDevice.Stop();
                this.playtime.audioDevice.PlayOneShot(this.playtime.aud_Numbers[this.jumps]);
                this.jumps++;
                this.jumpCount.text = this.jumps + "/" + this.jumpstodo.ToString();
                this.jumpDelay = 0.5f;
                if (this.jumps >= this.jumpstodo)
                {
                        this.playtime.audioDevice.Stop();
                        this.playtime.audioDevice.PlayOneShot(this.playtime.aud_Congrats);
                        this.ps.DeactivateJumpRope();
                }
        }

        // Token: 0x06000052 RID: 82
        private void Fail()
        {
                this.jumps = 0;
                this.jumpCount.text = this.jumps + "/" + this.jumpstodo.ToString();
                this.jumpDelay = 2f;
                this.playtime.audioDevice.PlayOneShot(this.playtime.aud_Oops);
        }

        // Token: 0x0400005C RID: 92
        public TMP_Text jumpCount;

        // Token: 0x0400005D RID: 93
        public Animator rope;

        // Token: 0x0400005E RID: 94
        public CameraScript cs;

        // Token: 0x0400005F RID: 95
        public PlayerScript ps;

        // Token: 0x04000060 RID: 96
        public PlaytimeScript playtime;

        // Token: 0x04000061 RID: 97
        public GameObject mobileIns;

        // Token: 0x04000062 RID: 98
        public int jumps;

        // Token: 0x04000063 RID: 99
        public float jumpDelay;

        // Token: 0x04000064 RID: 100
        public float ropePosition;

        // Token: 0x04000065 RID: 101
        public bool ropeHit;

        // Token: 0x04000066 RID: 102
        public bool jumpStarted;

        // Token: 0x040007CB RID: 1995
        public int jumpstodo;
}
._. yeah its just playtimes jumprope thing but its random


EDIT: found a bug, you may not want to use this
Sign up to access this!
  • Rendurse avatar
    Rendurse username pic Joined 2y ago
    DISCONNECTED
    565 points Ranked 45,470th
    11 medals 1 legendary 1 rare
    • Returned 5000 times Medal icon
    • Returned 1000 times Medal icon
    • Returned 100 times Medal icon
    • One month a member Medal icon
    • Received thanks 5 times Medal icon
    • Reached 10 subscribers Medal icon
    27d
    I made a (somewhat?) optimized version before you, but I can barely tell a difference.

    using System;
    using TMPro;
    using UnityEngine;

    // Token: 0x02000016 RID: 22
    public class JumpRopeScript : MonoBehaviour
    {
        // Token: 0x0600004D RID: 77 RVA: 0x00002064 File Offset: 0x00000264
        public JumpRopeScript()
        {
        }
        // Token: 0x0600004E RID: 78 RVA: 0x00009964 File Offset: 0x00007B64
        private void OnEnable()
        {
            this.jumpTimes = UnityEngine.Random.Range(1, 10);
            this.jumpDelay = 1f;
            this.ropeHit = true;
            this.jumpStarted = false;
            this.jumps = 0;
            this.jumpCount.text = 0 + "/" + this.jumpTimes;
            this.cs.jumpHeight = 0f;
            this.playtime.audioDevice.PlayOneShot(this.playtime.aud_ReadyGo);
        }
        // Token: 0x0600004F RID: 79 RVA: 0x000099F8 File Offset: 0x00007BF8
        private void Update()
        {
            if (this.jumpDelay > 0f)
            {
                this.jumpDelay -= Time.deltaTime;
            }
            else if (!this.jumpStarted)
            {
                this.jumpStarted = true;
                this.ropePosition = 1f;
                this.rope.SetTrigger("ActivateJumpRope");
                this.ropeHit = false;
            }
            if (this.ropePosition > 0f)
            {
                this.ropePosition -= Time.deltaTime;
                return;
            }
            if (!this.ropeHit)
            {
                this.RopeHit();
            }
        }
        // Token: 0x06000050 RID: 80 RVA: 0x00002381 File Offset: 0x00000581
        private void RopeHit()
        {
            this.ropeHit = true;
            if (this.cs.jumpHeight <= 0.2f)
            {
                this.Fail();
            }
            else
            {
                this.Success();
            }
            this.jumpStarted = false;
        }
        // Token: 0x06000051 RID: 81 RVA: 0x00009A88 File Offset: 0x00007C88
        private void Success()
        {
            this.playtime.audioDevice.Stop();
            this.playtime.audioDevice.PlayOneShot(this.playtime.aud_Numbers[this.jumps]);
            this.jumps++;
            this.jumpCount.text = this.jumps + "/" + this.jumpTimes;
            this.jumpDelay = 0.2f;
            if (this.jumps >= this.jumpTimes)
            {
                this.playtime.audioDevice.Stop();
                this.playtime.audioDevice.PlayOneShot(this.playtime.aud_Congrats);
                this.ps.DeactivateJumpRope();
            }
        }
        // Token: 0x06000052 RID: 82 RVA: 0x00009B84 File Offset: 0x00007D84
        private void Fail()
        {
            this.jumps = 0;
            this.jumpCount.text = this.jumps + "/" + this.jumpTimes;
            this.jumpDelay = 2f;
            this.playtime.audioDevice.PlayOneShot(this.playtime.aud_Oops);
        }
        // Token: 0x0400005C RID: 92
        public TMP_Text jumpCount;
        // Token: 0x0400005D RID: 93
        public Animator rope;
        // Token: 0x0400005E RID: 94
        public CameraScript cs;
        // Token: 0x0400005F RID: 95
        public PlayerScript ps;
        // Token: 0x04000060 RID: 96
        public PlaytimeScript playtime;
        // Token: 0x04000061 RID: 97
        public GameObject mobileIns;
        // Token: 0x04000062 RID: 98
        public int jumps;
        // Token: 0x04000063 RID: 99
        public float jumpDelay;
        // Token: 0x04000064 RID: 100
        public float ropePosition;
        // Token: 0x04000065 RID: 101
        public bool ropeHit;
        // Token: 0x04000066 RID: 102
        public bool jumpStarted;
        // Token: 0x04000067 RID: 103
        public int jumpTimes;
    }

    URL to post:
  • fazmade avatar
    fazmade Joined 2y ago
    no
    Cut Modder Studios Flag Affiliation: Cut Modder Studios
    217 points Ranked 56,608th
    13 medals 1 legendary 1 rare
    • 2019 Top Contributor Medal icon
    • Returned 1000 times Medal icon
    • One month a member Medal icon
    • Returned 100 times Medal icon
    • Submission featured Medal icon
    • Received thanks 5 times Medal icon
    27d
    so it just randomizes how much times you need to jump?
    g
    URL to post:

Embed

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

Credits

Original Authors
LeBaldi
LeBaldi Joined 2y ago
i died *coffin*
632 points Ranked 44,422nd
10 medals 1 rare
  • Returned 1000 times Medal icon
  • One month a member Medal icon
  • Returned 100 times Medal icon
  • 6 months a member Medal icon
  • Became a Studio Leader Medal icon
  • Thanked 5 submitters Medal icon
(me) made the script

Submitter

LeBaldi avatar
LeBaldi Joined 2y ago
i died *coffin*
632 points Ranked 44,422nd
10 medals 1 rare
  • Returned 1000 times Medal icon
  • One month a member Medal icon
  • Returned 100 times Medal icon
  • 6 months a member Medal icon
  • Became a Studio Leader Medal icon
  • Thanked 5 submitters Medal icon
LeBaldi
Creator
Sign up to access this!
Sign up to access this!
Sign up to access this!

Game

Sign up to access this!

Category

License

Share

  • Share on Reddit
  • Share on Twitter
  • Share on Facebook
  • 1
  • 291
  • 3
  • 27d
  • 27d

WiPs by Submitter

More Other/Misc Scripts