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

How would I make a permission list for this GUI?

Asked by 10 years ago

I need a list of people to be able to have "access" to a GUI.

I have a script written up here that is only applicable to the owner though;

game.Players.PlayerAdded:connect(function(playa) if playa.userId==game.CreatorId then playa.CharacterAdded:connect(function(char) script.REF:clone().Parent=playa.PlayerGui; end ) end end )

If anyone could write up a new one for a list, that'd be helpful.

Thanks.

1 answer

Log in to vote
1
Answered by 10 years ago

Since you didn't attempt to write a script for checking player names I'll explain to you what you should do...

  1. Create a table that has a list of the names... local peeps = {"Your mom","Your dad","Your granpappy"}

  2. Create a for statement that will check people's name when they join so

3.If the name of the player is equal to a name on the able then give the player the so desired gui.

script will look something like this

local peeps = {"meow"}

function CheckPlayer(p)
    for _,u in ipairs(peeps) do
        if p.Name == u then
            return true
        end
    end
end

function OnJoin(player)
    local check = CheckPlayer(player)
    if check == true then
        --bleh
    end
end

game.Players.PlayerAdded:connect(OnJoin)
Ad

Answer this question