Currently, my code is not working with me today, and I have had problems with my table. It claims that the text within the button on the table is not a valid thing.
local countries = script.Parent
for _,country in pairs(countries:GetChildren()) do
if country:IsA("ImageButton") then
local Time = 5
local com = require(game.ReplicatedStorage.NumberFormat)
local link = country.link
function cases()
local HttpService = game:GetService("HttpService")
local request = HttpService:GetAsync("https://api.com/countries/".. link.Value)
local Stats = HttpService:JSONDecode(request)
local count = Stats.cases
country.cases.Text = com.InsertCommas(count)
end
function deaths()
local HttpService = game:GetService("HttpService")
local request = HttpService:GetAsync("https://api.com/countries/".. link.Value)
local Stats = HttpService:JSONDecode(request)
local count = Stats.deaths
country.deaths.Text = com.InsertCommas(count)
end
function recovered()
local HttpService = game:GetService("HttpService")
local request = HttpService:GetAsync("https://api.com/countries/".. link.Value)
local Stats = HttpService:JSONDecode(request)
local count = Stats.recovered
country.recovered.Text = com.InsertCommas(count)
end
function casestoday()
local HttpService = game:GetService("HttpService")
local request = HttpService:GetAsync("https:/api.com/countries/".. link.Value)
local Stats = HttpService:JSONDecode(request)
local count = Stats.todayCases
country.casestoday.Text = com.InsertCommas(count)
end
function deathstoday()
local HttpService = game:GetService("HttpService")
local request = HttpService:GetAsync("api.com/countries/".. link.Value)
local Stats = HttpService:JSONDecode(request)
local count = Stats.todayDeaths
Frame.deathstoday.Text = com.InsertCommas(count)
end
while wait(Time) do
cases()
deaths()
recovered()
casestoday()
deathstoday()
end
else
print"oof"
end
end