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

Why isn't this boolvalue script working?

Asked by 9 years ago
base = game.Workspace.SurvivorCount
missionstxt = script.Parent.missions
if base.S1.Value == true and base.S2.Value == true then
    missionstxt.Text = "Mission One Complete!"
end

This script's location can be found here. This script is supposed to detect too see if both values are true, and if they are, they change the text of the textlabel (variable missionstxt).

1 answer

Log in to vote
0
Answered by 9 years ago

You probably want a changed event so you know when they are changed.

For example:

base = game.Workspace.SurvivorCount
missionstxt = script.Parent.missions
base.S1.Changed:connect(function()
    if base.S1.Value == true and base.S2.Value == true then
            missionstxt.Text = "Mission One Complete!"
    end
end)
base.S2.Changed:connect(function()
    if base.S1.Value == true and base.S2.Value == true then
            missionstxt.Text = "Mission One Complete!"
    end
end)

0
Thanks :D PyccknnXakep 1225 — 9y
0
Two changed events are not necessary, considering that you want BOTH values to be true. One or the other would be sufficient. Perci1 4988 — 9y
0
@Percil, what if S2 changed first and S1 second, then the Script wouldn't run. XtremeSpy 80 — 9y
Ad

Answer this question