I never used this method, and maybe its limited somehow i'm not sure, that maybe why the last 2 arent working. But I guess the only thing that you have to do is use tables.
01 | local list = { 38270341 , 291995028 , 131541716 , 41163273 , 303629801 , 759699976 } |
03 | game.Players.PlayerAdded:Connect( function (player) |
04 | player.CharacterAdded:Connect( function (char) |
06 | if player.UserId = = list [ i ] then |
07 | local gui = game.ServerStorage.DevTools:Clone() |
08 | gui.Parent = player.PlayerGui |
09 | print ( "gave " ..player.Name.. " DevTools" ) |
And in case you don't know much about tables lemme explain,
So pretty much we assigned the table list
and we put in it a couple of values, in our case those values are a number value (cuz IDs are numbers), a table is pretty much a variable that can store multiple values, and such as variables tables can have different types of values (integer, string, boolean, number.....)
So now, we have our values in our table; but how are we going to get them? for this you gotta do either do this
But this will just be boring and super inefficient, that's why we gotta use a generic for loop
1 | local list = { 38270341 , 291995028 , 131541716 , 41163273 , 303629801 , 759699976 } |
3 | for i, v in pairs (list) do |
you can do it with this, but on the 1st script i looped the table around using a for loop, sometimes i prefer doing that for having a condition, which is checking if the ids are similar
and its pretty much doing what a for loop gotta do but when we do list[i]
pretty much the i variable will go up by 1 so each time it loops it will do (list[1], list[2], [list[3]..)
so as you can see its all related but the ways change in terms of efficency, and if youre wondering what #list
, # is an operator, so #list refers to the numbet of values list has, which is 6 (so like that i will go from 1 to 6)
I hope I helped! and if this didn't work, well im always here ¯\_(?)_/¯