Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 6 years ago

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

Log in to vote
0
Answered by
Prestory 1395 Moderation Voter
6 years ago

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)
Ad

Answer this question