Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer

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

7 comments

0

Still not work :/

0

is there any error's?

0

Now not work the first result too

0

Any errors... but i take only the print("You can't")

0

Any errors in the output?

0

SORRY I messed up i forgot to add "then" , try it now

0

How did this get 2 upvotes? It's just spoonfeeding code

I am pretty sure this part is wrong:

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

Since you can not call it a number.

2 comments

0

You should try using the dictionary before saying it doesn't work

0

wtf

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

1 comment

0

Is good Zatruis script, is only for the "then" xD

This discussion is preserved as it was. New answers, comments, and votes are closed.