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