Im trying to find how to convent seconds into minutes on my time counter gui, but i cant find how to do it. If you could help, i would appreciate it.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TextLabel = script.Parent.time
ReplicatedStorage.Time.Changed:Connect(function(newTime)
TextLabel.Text = newTime
end)
if TextLabel.Text == 60 then
TextLabel.Text = "1:".. newTime
end
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TextLabel = script.Parent.time
ReplicatedStorage.Time.Changed:Connect(function(newTime)
TextLabel.Text = newTime
end)
local function toMS(s)
return string.format("%02i:%02i", s/60, s%60)
end
TextLabel.Text = toMS(newTime)
You need to do that for every time the time changes:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local function toMS(s)
return string.format("%02i:%02i", s/60, s%60)
end
local TextLabel = script.Parent.time
ReplicatedStorage.Time.Changed:Connect(function() -- this doesnt return an argument
TextLabel.Text = toMS(ReplicatedStorage.Time.Value)
end)
TextLabel.Text = toMS(ReplicatedStorage.Time.Value)