Attempt to call missing method 'GetChildren' of table

Hello Roblox developers! I need a bit of help with a script I am making, its a leaderboard that sees if your name matches the whitelisted names on my personal server / api.

For some reason, I can’t get the children from the JSON / table.

Can you probably help point me in the right direction and tell me what to do next time?

Thanks in advance.

image
Totally forgot about the image lol.

You cant get the Children of a table because it doesnt exist for the table, you basically already have the “children” in the table.

GetChildren returns a array of Children, having a function for it to return the exact same thing would be useless.

Even if the “:GetChildren()” were to function as you would have wished, the conditional statement would never equate to true since you would be comparing a string to a table.

It looks like your problem can be solved by simply using a table.find with the admins table. Example:

admincheckeven.OnServerEvent:Connect(function(plr)
   if table.find(response.admins, plr.Name) then
      ...
   end
end)

It seems like this does work, but I have another issue with my code. It doesn’t duplicate ‘player_’ when loaded into the game.

It doesn’t have any error.

What “player_” are you talking about? I’m not sure what your issue is

response.admins looks like this:

{
    admins = {12345, 7890, 18388, 823829}
}

Only instances have :GetChildren(), and there’s no way JSONDecode will return an instance or a table with an instance, since it comes from online.

I’m assuming you meant to do this:

if table.find(resposne.admins, plr.Name) then

If this doesn’t work, then we need more information on your issue and script.

An update about your ‘table.find’ method, it doesn’t work but it doesn’t give any error. Any other solution to fix this?

Im really confused on what your actual issue is. Are you trying to see if the player’s name can be found in the “response.admins” table? It seems like you’re having an issue that is unrelated to your original issue so provide more details on what problem you’re having and give us all context to your script

I originally had one issue. Which is about the response.admins table, now I have another issue where the “playercopy” doesnt appear on my leaderboard container when a username matches the ‘response.admins’ table.

I have found a better way to do this, rather than using an 3rd party HTTP service, I’m just going to do a ModuleScript with all of the admins names and userids of their accounts and save it to a Datastore.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.