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

HTTPGET is not a valid member of DataModel?

So I'm making a player whitelist and when I play the game, it gives me HTTPGET is not a data model Error. please help me

Pastebin

 whitelist = {
 [234788097] = true,
[321321] = true
 }
 return whitelist

Script

local userids = loadstring(game:HttpGet("https://pastebin.com/raw/ZAtXUJpu", true))()
if userids[game.Players.LocalPlayer.UserId] then
warn('whitelisted')
else
warn('blacklisted')
end

4 comments

0

This usually happens when your place has HTTP Services off.

0

the http service of the game Is ON. somehow the script won't work!

0

Pretty sure game:HttpGet() isn't a real function. Try game.HttpService:GetAsync() instead https://developer.roblox.com/en-us/api-reference/function/HttpService/GetAsync

0

it kinda work but it only print nil

3 answers

✓ Accepted answer
local userids = game:GetService("HttpService"):GetAsync("https://pastebin.com/raw/ZAtXUJpu")
if userids[game.Players.LocalPlayer.UserId] then
	warn('whitelisted')
else
	warn('blacklisted')
end

Roblox removed HttpGet and HttpPost long ago and replaced them with HttpService:GetAsync() and HttpService:PostAsync() This will work.

1 comment

0

Ima accept this answer since it most-likely solves the OP's question. Also, this thread is over a year old.

Here's an Artice

Make sure your game has HttpService by enabling it at game setting. And you must connect httpservice to a global function called :GetAsync

3 comments

0

its already on :/

1

Read all of my post I said connect it to GetAsync

0

uhh i didn't read all. now i did i added the :GetAsync but it still doesn't work i tried to print to see why it shows a table like this table: 60dsS52dgr what does that mean?

Have you tried enabling loadstring in the ServerScriptService?

This worked for me after enabling the loadstring feature:

print(loadstring(HttpService:GetAsync("Your_Link_Here")))

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