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

Proper way to access values?

I am trying to read a boolValue from outside the script, but when I try to read it studio will crash when I try to test it and nothing works in play. I have tried adding wait times before accessing the value, but it still did not work.

boolValue = script.Parent.InputBox.boolValue
--later in script:
if boolValue == true then
--run functions
else
--other stuff
end

2 answers

✓ Accepted answer

If it is a BoolValue, then the proper way to access its value would be:

if boolValue.Value then -- if boolValue is true

That happened on a computer I used, too. Thankfully it was only temporary. Nothing wrong with the script if studio crashes (Apart from while true dos with no waits). It crashes when you try to test, on all games. Try reinstalling ROBLOX. The syntax is correct, it doesn't work because there is no code to go with it, so I suggest printing something in the output when it's true, then looking in the output.

1 comment

0

Also, he needs to do boolValue.Value for where boolValue is later in the script, otherwise it will always return true if the boolValue exists.

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