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

Proper way to access values?

Asked by 10 years ago

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

Log in to vote
0
Answered by 10 years ago

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

if boolValue.Value then -- if boolValue is true

Ad
Log in to vote
-1
Answered by 10 years ago

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.

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. Spongocardo 1991 — 10y

Answer this question