hi everybody im trying to make a Ingame weekday in time with gui in when every gametime hit 0 Mon - Sun in this the script
local lighting = game:GetService("Lighting")
local replicatedStorage = game:GetService("ReplicatedStorage")
local event = replicatedStorage:findFirstChild("ChangeTime")
while wait(1) do
local hours = math.floor(lighting:GetMinutesAfterMidnight() / 60)
local suffix = "AM"
local days = "Sun"
local minutes = lighting:GetMinutesAfterMidnight() - (hours * 60)
if hours > 11 then
hours = hours - 12
suffix = "PM"
end
if hours == 0 then
hours = 12
end
if minutes < 10 then
minutes = "0" .. minutes
end
local text = days .. " " .. hours .. ":" .. minutes .. " " .. suffix
event:FireAllClients(text)
lighting:SetMinutesAfterMidnight(lighting:GetMinutesAfterMidnight() + 1)
end
Use the game’s clock to change the day every time it reaches a certain point in lighting by changing a number value maybe? After it reaches a certain value you can set it back maybe.
Maybe something like this? To detect the value being over 7 days.
script.Parent:GetPropertyChangedSignal("Value"):Connect(function()
if script.Parent.Value <= 8 then
script.Parent.Value = 1
end
end)
The day can then be changed to whatever you like from there. This is how I would do it.