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
ALLOWED_ACCESS = {
[111111] = true,
[222222] = true, 
[333333] = true,
}

function checkifallowed(userid)
    for ids,allowed in pairs(ALLOWED_ACCESS) do
        if ids == userid and allowed then
            return true
        else
            return false
        end
    end
end

wait(2)

if checkifallowed(game.Players.LocalPlayer.UserId) then
 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

ALLOWED_ACCESS = {
[111111] = true,
[222222] = true, 
[333333] = true,
}

function checkifallowed(userid)
    if ALLOWED_ACCESS[userid] then
         return true
        else
         return false
    end
end

wait(2)

if checkifallowed(game.Players.LocalPlayer.UserId) then
 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:

ALLOWED_ACCESS = {  
        [111111] = true,
    [222222] = true,
    [333333] = true
    };

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 — 4y
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:

ALLOWED_ACCESS = {
[111111] = true,
[222222] = true, 
[333333] = true
};

function checkifallowed(userid)
    if ALLOWED_ACCESS[userid] then
         return true
        else
         return false
    end
end

wait(2)

if checkifallowed(game.Players.LocalPlayer.UserId) then
 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