Hi, I have created a table of functions to make errors very efficiently
local Errors = {
Number = function(Value) -- Original
error("number expected, got " .. typeof(Value))
end,
String = function(Value) -- Original
error("string expected, got " .. typeof(Value))
end,
Boolean = function(Value) -- Original
error("boolean expected, got " .. typeof(Value))
end,
CustomError = function(Value,Expected) -- Made by flkfv
if typeof(Expected) == Value then
return true
end
return false, error(typeof(Value) .. ' expected, got ' .. typeof(Expected))
end,
}