Categories > Coding > Lua >

[help] Whitelist not working

Posts: 45

Threads: 18

Joined: Aug, 2022

Reputation: 2

Posted

I get this error whenever trying to run my script, one of its children is a module script that has the table in, not sure why its not working.

ServerScriptService.Fun.Fun Commands:20: invalid argument #1 to 'find' (table expected, got number)

if table.find(Player.UserId, Whitelists) then
  • 0

Posts: 112

Threads: 0

Joined: Feb, 2022

Reputation: 34

Replied

you switch up the arguments

if table.find(Whitelists, Player.UserId) then

  • 0

https://media.discordapp.net/attachments/706429709734510622/1138184558462902424/BEST_CLIP_EVER.gif?width=660&height=371

nickk

RealNickk

Posts: 18

Threads: 1

Joined: Dec, 2022

Reputation: 7

Replied

According to table.find documentation, you provide the table first, then the value to look for second. You have that mixed up.

table.find({ "Hello", "World" }, "World") --> 2
  • 0

Users viewing this thread:

( Members: 0, Guests: 1, Total: 1 )