How do you test a value (true or false) where it's need to be true for start function?
Asked by
7 years ago Edited 7 years ago
I have a function and a codepad. First you need to type the code before the button works.
But the value is False = 0 True = 1
And when it goes one after typed the code the click function will still not work.
The only problem is the part I added now. The function by itself works fine.
02 | local Launch = workspace.RocketOne.CodePad.Launch |
04 | script.Parent.ClickDetector.MaxActivationDistance = 0 |
05 | script.Parent.Parent.Core.A.Volume = 0.4 |
06 | script.Parent.Parent.Core.A:Play() |
07 | script.Parent.BrickColor = BrickColor.new( "Bright red" ) |
09 | script.Parent.Parent.Core.A:Stop() |
10 | script.Parent.Parent.Core.B:Play() |
12 | script.Parent.Parent.Door.CanCollide = true |
13 | script.Parent.Parent.Door.Transparency = 0.75 |
15 | script.Parent.Parent.Door.Transparency = 0.5 |
17 | script.Parent.Parent.Door.Transparency = 0.25 |
19 | script.Parent.Parent.Door.Transparency = 0 |
21 | script.Parent.Parent.Motor.BodyAngularVelocity.AngularVelocity = Vector 3. new( 0 , 0.2 , 0 ) |
23 | script.Parent.Parent.Core.Decoupler.Volume = 0.8 |
24 | script.Parent.Parent.Core.Decoupler:Play() |
25 | script.Parent.Parent.Booster.Engine 1. ParticleEmitter.Enabled = true |
26 | script.Parent.Parent.Booster.Engine 1. Smoke.Enabled = true |
27 | script.Parent.Parent.Booster.Engine 2. ParticleEmitter.Enabled = true |
28 | script.Parent.Parent.Booster.Engine 2. Smoke.Enabled = true |
29 | script.Parent.Parent.Booster.Engine 3. ParticleEmitter.Enabled = true |
30 | script.Parent.Parent.Booster.Engine 3. Smoke.Enabled = true |
31 | script.Parent.Parent.Booster.Engine 4. ParticleEmitter.Enabled = true |
32 | script.Parent.Parent.Booster.Engine 4. Smoke.Enabled = true |
33 | script.Parent.Parent.Core.C.Volume = 0.8 |
34 | script.Parent.Parent.Core.C:Play() |
35 | script.Parent.Parent.E 1. BrickColor = BrickColor.new( "Lime green" ) |
38 | script.Parent.Parent.Core.BodyVelocity.Velocity = Vector 3. new( 0 ,i, 0 ) |
42 | script.Parent.Parent.Booster.Engine 1. ParticleEmitter.Enabled = false |
43 | script.Parent.Parent.Booster.Engine 1. Smoke.Enabled = false |
44 | script.Parent.Parent.Booster.Engine 2. ParticleEmitter.Enabled = false |
45 | script.Parent.Parent.Booster.Engine 2. Smoke.Enabled = false |
46 | script.Parent.Parent.Booster.Engine 3. ParticleEmitter.Enabled = false |
47 | script.Parent.Parent.Booster.Engine 3. Smoke.Enabled = false |
48 | script.Parent.Parent.Booster.Engine 4. ParticleEmitter.Enabled = false |
49 | script.Parent.Parent.Booster.Engine 4. Smoke.Enabled = false |
50 | script.Parent.Parent.Core.C:Stop() |
51 | script.Parent.Parent.E 1. BrickColor = BrickColor.new( "Really red" ) |
53 | script.Parent.Parent.Core.Decoupler:Play() |
54 | script.Parent.Parent.Joint 1 :Destroy() |
55 | script.Parent.Parent.Joint 2 :Destroy() |
56 | script.Parent.Parent.Joint 3 :Destroy() |
57 | script.Parent.Parent.Joint 4 :Destroy() |
59 | script.Parent.Parent.Engine 5. ParticleEmitter.Enabled = true |
60 | script.Parent.Parent.Core.D:Play() |
61 | script.Parent.Parent.Core.BodyVelocity.Velocity = Vector 3. new( 0 , 100 , 0 ) |
62 | script.Parent.Parent.E 2. BrickColor = BrickColor.new( "Lime green" ) |
64 | script.Parent.Parent.Engine 5. ParticleEmitter.Enabled = false |
65 | script.Parent.Parent.Core.D:Stop() |
66 | script.Parent.BrickColor = BrickColor.new( "Deep orange" ) |
67 | script.Parent.Parent.E 2. BrickColor = BrickColor.new( "Really red" ) |
69 | script.Parent.Parent.Joint 5 :BreakJoints() |
70 | script.Parent.Parent.Core.Decoupler:Play() |
72 | script.Parent.Parent.Core.E:Play() |
73 | script.Parent.Parent.Engine 6. ParticleEmitter.Enabled = true |
74 | script.Parent.Parent.Core.BodyVelocity.Velocity = Vector 3. new( 0 , 125 , 0 ) |
75 | script.Parent.Parent.E 3. BrickColor = BrickColor.new( "Lime green" ) |
79 | script.Parent.ClickDetector.MouseClick:connect(onClicked) |