So i was just testing my code, it worked for a few seconds, Then i got this weird error that i have never ever seen before.
This is what it looks like from client-side and server-side
15:00:33.086 error in error handling - Server - Script:6
15:00:33.122 Stack Begin - Studio
15:00:33.122 Script 'ServerScriptService.Script', Line 6 - function ResponseTime - Studio - Script:6
15:00:33.123 Script 'ServerScriptService.Script', Line 15 - function ResponseTime (x21998) - Studio - Script:15
15:00:36.945 Script 'ServerScriptService.Script', Line 13 - function ResponseTime (x499) - Studio - Script:13
15:00:37.030 Script 'ServerScriptService.Script', Line 30 - Studio - Script:30
15:00:37.030 Stack End - Studio
This is my code
local TimeRemote = game:GetService("ReplicatedStorage").ResponseTime
local Link = "https://WhyYouLookingHere-5000.DontLookAtThisLink.devtunnels.StopNow/"
local LocalLink = "http://localhost:5000"
local HttpService = game:GetService("HttpService")
local function ResponseTime()
if game:GetService("RunService"):IsStudio() then
local Time = os.clock()
local Success,Error = pcall(function()
HttpService:GetAsync(LocalLink)
end)
if Success then
TimeRemote:FireAllClients(string.format("%.2f",tostring((os.clock()-Time)*1000)))
ResponseTime()
else
ResponseTime()
end
else
local Time = os.clock()
local Success,Error = pcall(function()
HttpService:GetAsync(Link)
end)
if Success then
TimeRemote:FireAllClients(string.format("%.2f",tostring((os.clock()-Time)*1000)))
ResponseTime()
else
ResponseTime()
end
end
end
ResponseTime()
Basically my code just sends a GET request to my API.