Hi everyone,
I am new to scripting and decided to play around with DateTime, I have tried to make this script that updates the text on a text label every second with the current time, but it seems to cuase major lag when attempting to play the game. However, when i run the code there is no lag and it works fine.
Can anybody explain to me why this is, I would much appreciate it!
while true do
local DT = DateTime.now()
game.Workspace.Screen.SurfaceGui.Frame.TextLabel.Text = DT:FormatLocalTime("LLLL", "en-us")
task.wait(1)
end
This is the script, if you could explain to me what is wrong with it that would be super helpful with my development journey!