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

i get bad argument #1 to 'pairs' (table expected, got string) can someone help?

Asked by
sbot50 3
5 years ago

error: 22:37:51.965 - ServerScriptService.ServerMessageHandler:4: bad argument #1 to 'pairs' (table expected, got string)

code: !this is the code, what did i do wrong?

0
You're using parentheses, not table brackets. https://developer.roblox.com/articles/Table TheeDeathCaster 2368 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago

To define a table, you need to use these brackets "{ }" instead of parentheses "( )" since the parentheses are simply used to enclose a string or an operator set together.

Simply change this line

local allowed = ("sbot50")

to

 local allowed = {"sbot50"}
1
thanks, this works sbot50 3 — 5y
Ad

Answer this question