As I was working on a module script, I found that when I tried calling a "return true" or "return false", it'd either "return nothing" or "return nil". I tried to figure out why it was doing this, but was unable to come to a conclusion.
function api.isPlayer(name) local s, m = pcall(function() local plr = Players:FindFirstChild(name) if plr then return true else return false end end) if s then return else error(m) end end
If you're expecting the api.isPlayer
function to return either of those, it won't because you're not returning anything if the pcall succeeds. you should modify if s then return ...
to if else then return m
.