How to compare a value from a modulescript table to other value

Hi! I want to make something like a permission system… there is a table with authorized players in a ModuleScript

I don’t know how to check if the player name is in the table

Thanks :smiley:

local LOL = {}
local TABLE = {
	"whataname",
    "ok"
}
function LOL.GetTable(Player:Player?)
	if table.find(TABLE, Player.Name) then
		return true
	else
		return false
	end
end
return LOL
--
Players.PlayerAdded:Connect(function(Player)
    print(require(script.Parent.ModuleScript).GetTable(Player)) -- should print true if player name is in table.
end)
1 Like

How does return works? Also, can I change true and false to other values? Like: Passed, Failed

It will return true if it passed. (Player has permission)
It will return false if it failed. (Player does not have permission)
You can pretty much change it to everything if you wanna. All it does is check the table for the player name.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.