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?
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
I am pretty sure this part is wrong:
ALLOWED_ACCESS = { [111111] = true, [222222] = true, [333333] = true };
Since you can not call it a number.
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