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

How do i check if a bool value is changed to false or the value is false to begin with?

How do i check if a bool value is changed to false or the value is false to begin with without copy and pasting the code (too much code to copy and paste and wouldn't be efficient) e.g:

BoolValue.Changed:connect(function(NewValue) 
	if NewValue == false then
	--Lots of code
	end
end)


if BoolValue == false then
	--Lots of code (exact same as above)
end

How would i join these together for efficiency therefore considerably lowering the script line count?

2 comments

0

i really dont wanna copy and paste the code as it would turn the script into 600 lines instead of 300 plus i need to copy and paste this script multiple times and change a few values as it applies to other scenarios

0

NVM ive used bindable function to make the script line considerably lower

1 answer

✓ Accepted answer

If you want to check if it has changed then try this checks at a wait time of however you want it checks if the bool is false

local Bool = false

While wait() do 
 if Bool == false then
          print(“Boolean is false..”)
end
       end 

1 comment

0

while true do is not capitalized

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