Function returns nil

I’ve got a simple function converting miniutes into hours:miniutes:

function GetMinFormatted(m)
	local hours = math.floor(m / 60)
	local pmins = m - (hours * 60)
	if pmins < 10 then pmins = '0'..pmins end
	return(hours..':'..pmins or '0:00')
end

And the function is only used in this instance:

min:GetPropertyChangedSignal('Value'):Connect(function()
	t.Text = 'Year '..year.Value..', '..Months[month.Value]..' '..day.Value..getEnding(day.Value)..' '..GetMinFormatted(min.Value)
end)

Expected output example: 'Year 5, Sep 21st 3:06'

All inputs aren’t nil so I can’t figure out the source of the error

Forgot to include this but here’s my error message

Are you sure min.Value exists?

forgot to mention I fixed the issue.

Yes min.Value exists.

To solve the issue i had to split the string into different variables

	local pstring = GetMinFormatted(min.Value)..', '..ProccessDayOfWeek(day.Value,month.Value,year.Value)
	local sval = ' '..day.Value..getEnding(day.Value)
	local tval = ' of '..Months[month.Value]..', Year '..year.Value
	t.Text = pstring..sval..tval

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