Imagelabel not changing as expected from the script

So I wish to make a timer using images for each number.


Which for the most park works fine as depicted above. However a defect I haven’t been able to sort out properly is turning the tens digit invisible so numbers are displayed as “7” instead of “07”.

local value = workspace.GameValues.CurrentRound.Time -- the timer's value that I want to use for these 3 images
local ni = {
	14313419759, --0
	14313422119, --1
	14313424375, --2
	14313427331, --and so forth and so on
	14313429470,
	14313431377,
	14313433374,
	14313435059,
	14313437440,
	14313439722
}
local aux
local function onValueChanged(newValue)
	aux = math.floor(value.Value/100%10)
	if aux~=0 then
		script.Parent.i100.Image = ("rbxassetid://"..ni[aux+1])
	else script.Parent.i100.Image = ("rbxassetid://11577778446")
	end
	aux = math.floor(value.Value/10%10)
	if aux~=0 or script.Parent.i100.Image ~= "rbxassetid://11577778446" then
		script.Parent.i10.Image = ("rbxassetid://"..ni[aux+1])
	else script.Parent.i10.Image = ("rbxassetid://11577778446")
	end
	script.Parent.i10.Image = ("rbxassetid://"..ni[aux+1])
	aux = math.floor(value.Value%10)
	script.Parent.i1.Image = ("rbxassetid://"..ni[aux+1])
end

value.Changed:Connect(onValueChanged)

As well as the explorer hierarchy (i1 represents the units, i10 tens and i100 hundreds)
image

I’ve opted to use images instead of the .Visible purely to lessen the lines of code, the 11577778446 image being an image that got moderated and is thus invisible.

Yet despite it working for the hundreds, the tens digit seems to show as 0 instead of turning invisible.
image

Bro wth are these images :skull: Roblox is a kids game bro

Anyways, it looks like you somehow find the individual number and use that table to crossreference which asset to be displayed at a given time. And youve made an exception for when this number is ISNT and IS zero. But you need to make ANOTHER exception right before that to find out the total of BOTH digits and figure out if they are less than 10, to then set the visibility to 0


Solved, I’m unnaturally dumb today

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