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 11 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 11 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

01local peeps = {"meow"}
02 
03function CheckPlayer(p)
04    for _,u in ipairs(peeps) do
05        if p.Name == u then
06            return true
07        end
08    end
09end
10 
11function OnJoin(player)
12    local check = CheckPlayer(player)
13    if check == true then
14        --bleh
15    end
16end
17 
18game.Players.PlayerAdded:connect(OnJoin)
Ad

Answer this question