it's honestly not that hard
it just calls the function you provide in protected mode
pcall(yourfunction(arguments if you need any for your function as well))
but what it does first is returns true or false, depending if your function ran successfully
it also returns anything that your function returns upon calling it
if it happens to error, it will return false, and the error message
local success, errorMsg = pcall(yourFunction())
if success then
print("all is fine in the world")
else
print("rip: "..errorMsg)
end |