Why is my text nil?

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

image

Can we see your com module? I can only imagine the issue may lie inside. More info may tell.

It looks like there is a lot of missing code.

I don’t assume that this is your problem and it would be great if you could post your entire code and any Scripts or ModuleScripts that it references.

Its fine. I have shutdown the games development because, new to my knowledge, a coronavirus tracker is against TOS. Thank you.

2 Likes