Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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.

01function onClicked()
02    local Launch = workspace.RocketOne.CodePad.Launch
03    if Launch == 1 then
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")
08        wait(10)
09        script.Parent.Parent.Core.A:Stop()
10        script.Parent.Parent.Core.B:Play()
11        wait(3)
12        script.Parent.Parent.Door.CanCollide=true
13        script.Parent.Parent.Door.Transparency=0.75
14        wait(0.1)
15        script.Parent.Parent.Door.Transparency=0.5
View all 79 lines...

1 answer

Log in to vote
1
Answered by 7 years ago

If Launch from workspace.RocketOne.CodePad.Launch is a Value of any sort, you simply need to add .Value to the end of it:

1function onClicked()
2    local Launch = workspace.RocketOne.CodePad.Launch.Value -- Gets the Value of whatever Launch is
3    if Launch == 1 then
0
I kind of already know that just loong time ago I last scripted. =/ MineJulRBX 52 — 7y
Ad

Answer this question