Heya. I have a GUI that should appear for admins when they join, however, it also appears for non-admins when they die. Now, there's nothing special in the GUI, but I'd still like to fix this.
local admins = {
"Player1";
"Player2";
"Player3";
"Player4"
}
local function isAdmin(player)
for _, v in pairs(admins) do
if v == player.Name then
return true
end
end
return false
end
local Players = game:GetService("Players")
local AW = game.StarterGui.AdminWelcome.Gradient
Players.PlayerAdded:Connect(function(player)
if isAdmin(player) then
AW.Visible = true
else
AW.Visible = false
end
end)
Any help is appreciated.

1 comment
change line 22 to "if isAdmin(player) == true then" because if you don't write true then it means it's not nill