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

script not detecting if boolvalue is true?

Why doesn't this work?

if game.Workspace.Value == true then
	print("Value is true")
end

1 comment

0

Note: I forgot to put .Value but even adding .Value it still doesn't work.

2 answers

✓ Accepted answer

You shouldn't name your values "Value" because that probably messes up stuff in the game, I recall being unable to set my value because it was named Value, anyways, rename it and you should be good to go.

if game.Workspace.betterVariable.Value == true then
    print("Value is true")
end

Also remember to add that .Value, if it doesn't work then it didn't load. If this helped please accept my answer

2 comments

0

That didn't work either so I resorted to using the Changed Event.

0

Wait you didn't put that in a loop, theres no doubt thats the reason it didn't work...

You're referencing the object, and not the .Value property. You need to also make sure that when the if statement happens, the value is true.

if game.Workspace.Value.Value == true then
    print("Value is true")
end

3 comments

0

Yeah that still doesn't work

0

like i said, make sure the value is true when the if statement happen

0

It still does not work.

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