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
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
NVM ive used bindable function to make the script line considerably lower