so if not success then is sometimes used on other scripters, but why it is used? it is only used to know an error?
COMMUNITY QUESTION
Why is if not success then is used?
1 answer
Here we set up for that situation:
local success, message = pcall(function()
-- Let us say I have a script that does not need to work but I want to know if it fails in here
end)
if not success then
print("Non crucial code failed error is: "..message)
end
This time I don't want to do anything if it is successful so I use if not success so that it only passes the if statement if there was a failure. I hope this helps and have a great day scripting!
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
It's used to check if the script failed.
or in case of datastores have a 'backup' system
basically you mean its used in pcalls to check if the call succeeded or not