TimeValue = Instance.new("NumberValue")
local PlayerGui = game:GetService("Players").LocalPlayer.PlayerGui local TextLabel = PlayerGui.ScreenGui.TextLabel
while true do
TimeValue.Value = 6 TextLabel.Text = "Time:".. TimeValue.Value..":00".. "AM" .. "[Day Shift]" wait(30) TimeValue.Value = 7 TextLabel.Text = "Time:" .. TimeValue.Value..":00".. "AM" .. "[Day Shift]" wait(30) TimeValue.Value = 8 TextLabel.Text = "Time:" .. TimeValue.Value..":00".. "AM" .. "[Day Shift]" wait(30) TimeValue.Value = 9 TextLabel.Text = "Time:" .. TimeValue.Value..":00".. "AM" .. "[Day Shift]" wait(30) TimeValue.Value = 10 TextLabel.Text = "Time:" .. TimeValue.Value..":00".. "AM" .. "[Day Shift]" wait(30) TimeValue.Value = 11 TextLabel.Text = "Time:" .. TimeValue.Value..":00".. "AM" .. "[Day Shift]" wait(30) TimeValue.Value = 12 TextLabel.Text = "Time:" .. TimeValue.Value..":00".. "PM" .. "[Day Shift]" wait(30) TimeValue.Value = 1 TextLabel.Text = "Time:" .. TimeValue.Value..":00".. "PM" .. "[Day Shift]" wait(30) TimeValue.Value = 2 TextLabel.Text = "Time:" .. TimeValue.Value..":00".. "PM" .. "[Day Shift]" wait(30) TimeValue.Value = 3 TextLabel.Text = "Time:" .. TimeValue.Value..":00".. "PM" .. "[Day Shift]" wait(30) TimeValue.Value = 4 TextLabel.Text = "Time:" .. TimeValue.Value..":00".. "PM" .. "[Day Shift]" wait(30) TimeValue.Value = 5 TextLabel.Text = "Time:" .. TimeValue.Value..":00".. "PM" .. "[Day Shift]" wait(30) TimeValue.Value = 6 TextLabel.Text = "Time:" .. TimeValue.Value..":00".. "PM" .. "[Day Shift]" wait(30) TimeValue.Value = 7 TextLabel.Text = "Time:" .. TimeValue.Value..":00".. "PM" .. "[Day Shift]"
end
Simple look into how you would go about doing this.
Server Script
game.ReplicatedStorage.RemoteEvent:FireClient(player,'I love hamburger')
Local Script
game.ReplicatedStorage.RemoteEvent.OnClientEvent:Connect(function(text) script.Parent.TextLable.Text = text end)
Here is a deep dive into the topic of remote events/functions
https://developer.roblox.com/en-us/articles/Remote-Functions-and-Events
Edit: Reply to your comment :)
when doing GUI clocks the counter is housed on the server and the display is on the client...if that makes since
so on the server you would run the clock function and fire a remote function for every second
for x = 60,0,-1 do for i,v in pairs(game.Players:GetPlayers())do game.ReplicatedStorage.RemoteFunction:FireClient(x) wait(1) end end
on the client you would update the display
game.ReplicatedStorage.RemoteFunction.OnClientEvent:Connect(function(x) script.Parent.TextLabel.Text = x end
This would allow the clock to be synced across all client, the only delay would be client load times(this would not effect any other client)