i am trying to make a script that doesn't let certain people do certain things unless they are on a whitelist. It doesn't work in game and i don't really know what to do, i have tried many things.
local player = game.Players.LocalPlayer
local gui = player:WaitForChild("PlayerGui").GameIntro.Start
local audio = player:WaitForChild("PlayerGui").PlayerAudio
gui.Play.MouseButton1Click:connect(function()
if workspace.Value.Value == true then
if gui.Parent.CanClick.Value == true then
local id = player:GetFullName() -- gets players full username
if id == "Creeper_Dude158" or "SteamSkele" then -- checks if the players full name is one of these
-- not important for the issue --
end
end
end
end)
any player can get through, not the only makes listed there. Any help and a solution? I've been searching for a while now.
the script is in a local script in starter player scripts.

8 comments
You need to check
ideach and every time. (Ex,if id == val or id == val) Otherwise, it's telling the scriptif id is equal to name or string is true then.so if i check for the player id?
You'd do it as
if id == "Name1" or id == "Name2" then.should i use script. parents to get the player name since the script is inside of the player?
Nope, getting the LocalPlayer is plenty enough. :) Although if you're saying this's a Script, then
LocalPlayerwont work. :c (LocalPlayer is for LocalScripts)ok
should i use .Name or :GetFullName() or are they both the same thing
I recommend
.Name, since (if memory serves)GetFullNamewill return something likegame.Players.Player_Name.