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.
Since you didn't attempt to write a script for checking player names I'll explain to you what you should do...
Create a table that has a list of the names...
local peeps = {"Your mom","Your dad","Your granpappy"}
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
01 | local peeps = { "meow" } |
02 |
03 | function CheckPlayer(p) |
04 | for _,u in ipairs (peeps) do |
05 | if p.Name = = u then |
06 | return true |
07 | end |
08 | end |
09 | end |
10 |
11 | function OnJoin(player) |
12 | local check = CheckPlayer(player) |
13 | if check = = true then |
14 | --bleh |
15 | end |
16 | end |
17 |
18 | game.Players.PlayerAdded:connect(OnJoin) |