Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Making Script where only certain people can see GUI any help?

so ive been trying to make a script where only certain people can see this specific GUI. I came up with this but it doesnt work any help?


local VIPs = {"Name","Name2","Name3"}
function VIP(player)
for i = 1, #VIPs do
if player.Name == VIPs[i] then
game.StarterGui.ButtonGui.TextButton.Visible =true
end
end
end


1 answer

✓ Accepted answer

This should do the trick!

local players = game:GetService("Players")

function addPlayer(player)
    local isVip = {["WillBe_Stoped"] = true, [""] = true, [""] = true,[""]= true,[""]= true,[""]= true}
    if isVip[game.Players.LocalPlayer.Name] then
	script.Parent.Frame.TextLabel.Visible = true
    end
end


for _,player in pairs(players:GetPlayers())do
    addPlayer(player)
end


players.PlayerAdded:connect(addPlayer)

This discussion is preserved as it was. New answers, comments, and votes are closed.