Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why isn't this boolvalue script working?

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

✓ Accepted answer

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)

3 comments

0

Thanks :D

0

Two changed events are not necessary, considering that you want BOTH values to be true. One or the other would be sufficient.

0

@Percil, what if S2 changed first and S1 second, then the Script wouldn't run.

This discussion is preserved as it was. New answers, comments, and votes are closed.