01 | ALLOWED_ACCESS = { |
02 | [ 111111 ] = true , |
03 | [ 222222 ] = true , |
04 | [ 333333 ] = true , |
05 | } |
06 |
07 | function checkifallowed(userid) |
08 | for ids,allowed in pairs (ALLOWED_ACCESS) do |
09 | if ids = = userid and allowed then |
10 | return true |
11 | else |
12 | return false |
13 | end |
14 | end |
15 | end |
16 |
17 | wait( 2 ) |
18 |
19 | if checkifallowed(game.Players.LocalPlayer.UserId) then |
20 | ecc ecc |
Take only the first result [1111111], and ignore the other one.. why?
Hello sorry i've fixed it :D
01 | ALLOWED_ACCESS = { |
02 | [ 111111 ] = true , |
03 | [ 222222 ] = true , |
04 | [ 333333 ] = true , |
05 | } |
06 |
07 | function checkifallowed(userid) |
08 | if ALLOWED_ACCESS [ userid ] then |
09 | return true |
10 | else |
11 | return false |
12 | end |
13 | end |
14 |
15 | wait( 2 ) |
16 |
17 | if checkifallowed(game.Players.LocalPlayer.UserId) then |
18 | ecc ecc |
I am pretty sure this part is wrong:
1 | ALLOWED_ACCESS = { |
2 | [ 111111 ] = true , |
3 | [ 222222 ] = true , |
4 | [ 333333 ] = true |
5 | } ; |
Since you can not call it a number.
Alright, so I may be wrong, but I know the answer. Try this script:
01 | ALLOWED_ACCESS = { |
02 | [ 111111 ] = true , |
03 | [ 222222 ] = true , |
04 | [ 333333 ] = true |
05 | } ; |
06 |
07 | function checkifallowed(userid) |
08 | if ALLOWED_ACCESS [ userid ] then |
09 | return true |
10 | else |
11 | return false |
12 | end |
13 | end |
14 |
15 | wait( 2 ) |
16 |
17 | if checkifallowed(game.Players.LocalPlayer.UserId) then |
18 | ecc ecc |
I'm guessing your problem was that you forgot to take out the comma after your last table variable. Hope this helps!
-- AquxDev