Title sort of explains all.
COMMUNITY QUESTION
How do you make an if statement end the script if a condition is met?
2 answers
You would use a break statement, search it on the wiki for more information.
Here's an example, we will be using a BoolValue for this example that has just been changed to true. The script is a child of Boolvalue
script.Parent.Changed:connect(function() -- This just detects a change in a bools value, it does not need to be added.
if script.Parent.Value == true then -- Replace "script.Parent.Value == true" with your statement.
print("Condition met") -- Ends the script with a print.
else
print("Condition not met") -- If you want to put some code here if the bool does not meet the requirements then do.
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Breaks only work with loops and skips through them, I meant something that ends the script entirely.
Ends the script entirely? You could just do script.Disabled = true if you wanted