In my admin script, I need to find out if the player who is chatting is listed in the table or not. Is there some type of string function that can be used to search a table?
local Admins = {"RedCombee"} local function CheckIfAdmin(Player) for _,adminName in pairs(Admins) do --What this does is makes it so "adminName" is the words in the table Admins if Player.Name == adminName then --If the player's name is the same as adminName, then: return true else --Anything else except if the player's name is the same as adminName return false end end end for _,player in pairs(game.Players:GetPlayers()) do --What this does it makes it so "player" is every player in the game player.Chatted:connect(function(message) if CheckIfAdmin(player) == true then --calls the function we made earlier --CODE HERE :) end end) end
*Heres a TIP not a "answer" but this will get your started on the correct path ;D*
Table={'RedCombee','MessorAdmin','idjwijwdiwjdiwidjwidwidj'}; function G(Plr) for _,v in pairs(Table) do print(v) if v==Plr:lower() or v==Plr.Name:lower() then print(Plr) end G(game.Players.RedCombee)