Can not use HTTP Service

Hello,

I am trying to get the account age by name (the player can be offline) and I am trying to send a GET Request to get the creation of the account but I can not…

Localscript:

local btn = script.Parent.ValidBtn
local input = script.Parent.Input

local age = script.Parent.PlrAge
local id = script.Parent.PlrID
local name = script.Parent.PlrName

local plrs = game:GetService("Players")
local http = game:GetService("HttpService")

local event = script.Parent.GetRequestResult

btn.MouseButton1Click:Connect(function()
	local target_id = plrs:GetUserIdFromNameAsync(input.Text)
	local target_name = plrs:GetNameFromUserIdAsync(target_id)
	
	local URL = "https://users.roblox.com/v1/users/"..tostring(target_id)
	
	local r = event:InvokeServer(URL)
	
	--local createdTime = DateTime.fromIsoDate("").UnixTimestamp
	--local currentTime = DateTime.now().UnixTimestamp

	--local accountAgeDays = (currentTime - createdTime)/86400
	
	id.Text = " Id: "..tostring(target_id)
	name.Text = " Name: "..tostring(target_name)
end)

Script:

local event = script.Parent.GetRequestResult

local function getRequestResult(player, url)
	return game:GetService("HttpService"):GetAsync(url)
end

event.OnServerInvoke = getRequestResult

AFAIK, you can’t access Roblox services using HTTP Service. You would have to use a proxy

1 Like

There is a available proxy or not?

Idk, maybe. If not, you can try hosting your own or something

Just, I can get the account age of an user without using this method ?

Yes, Go to game.Players in studio, Select yourself and your account age (In days) Will be there

It is going to be listed in the properties.

You did not understand… I am trying to get the account age of a offline player.

U can use a local plr = game.Players:GetUserIdFromNameAsync(userid) in order to achieve that

Did you read my code?

local target_id = plrs:GetUserIdFromNameAsync(input.Text)
local target_name = plrs:GetNameFromUserIdAsync(target_id)

Look, If u are trying to get data from an player that has never played the game before, U will have to use a different proxy to achieve that.
There is no other workarounds.

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