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

Who can HELP me with ALLOWED_ACCESS? This LocalScript not work!

Asked by 5 years ago
Edited 5 years ago
01ALLOWED_ACCESS = {
02[111111] = true,
03[222222] = true,
04[333333] = true,
05}
06 
07function 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
15end
16 
17wait(2)
18 
19if checkifallowed(game.Players.LocalPlayer.UserId) then
20 ecc ecc

Take only the first result [1111111], and ignore the other one.. why?

3 answers

Log in to vote
0
Answered by
VitroxVox 884 Moderation Voter
5 years ago
Edited 5 years ago

Hello sorry i've fixed it :D

01ALLOWED_ACCESS = {
02[111111] = true,
03[222222] = true,
04[333333] = true,
05}
06 
07function checkifallowed(userid)
08    if ALLOWED_ACCESS[userid] then
09         return true
10        else
11         return false
12    end
13end
14 
15wait(2)
16 
17if checkifallowed(game.Players.LocalPlayer.UserId) then
18 ecc ecc
0
Still not work :/ GuerraReturns 122 — 5y
0
is there any error's? VitroxVox 884 — 5y
0
Now not work the first result too GuerraReturns 122 — 5y
0
Any errors... but i take only the print("You can't") GuerraReturns 122 — 5y
View all comments (3 more)
0
Any errors in the output? VitroxVox 884 — 5y
0
SORRY I messed up i forgot to add "then" , try it now VitroxVox 884 — 5y
0
How did this get 2 upvotes? It's just spoonfeeding code hiimgoodpack 2009 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

I am pretty sure this part is wrong:

1ALLOWED_ACCESS = { 
2        [111111] = true,
3    [222222] = true,
4    [333333] = true
5    };

Since you can not call it a number.

0
You should try using the dictionary before saying it doesn't work hiimgoodpack 2009 — 5y
0
wtf snowwyyyyy2 30 — 5y
Log in to vote
-1
Answered by
Aqu_ia 39
5 years ago

Alright, so I may be wrong, but I know the answer. Try this script:

01ALLOWED_ACCESS = {
02[111111] = true,
03[222222] = true,
04[333333] = true
05};
06 
07function checkifallowed(userid)
08    if ALLOWED_ACCESS[userid] then
09         return true
10        else
11         return false
12    end
13end
14 
15wait(2)
16 
17if 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

0
Is good Zatruis script, is only for the "then" xD GuerraReturns 122 — 5y

Answer this question