So far, what I have done is created this bit of code.
CheckIfAllowed = true game.Players.PlayerAdded:connect(function(plr) plr.CharacterAdded:connect(function(CheckIfAllowed) if plr == [INSERT NAME HERE] then return false end end) end) if CheckIfAllowed then -- Past here is working code
What I wanted to do is make it so that certain people are exempt from certain functions. However, this doesn't appear to be working. I wanted to know if there's any way to do this or not? Also, if someone can also tell me how to make a list of players from a local or something else like that instead of having the [INSERT NAME HERE] (so that it checks multiple people) it would be much appreciated.
The current issue with your script is, you should have plr.Name not just plr on line 5, as currently you're trying to check the actual player instance against a string, instead of the player's name.
To check multiple people, you could have a table inside your code:
local tableofexclusions = {"Name1", "Name2", "Name3"} game.Players.PlayerAdded:connect(function(plr) plr.CharacterAdded:connect(function(CheckIfAllowed) for i,v in pairs(tableofexclusions) do if v == plr.Name then return false end end end) end)
This 'For' loop will check the player's name against every name inside the table.