TimeValue = Instance.new("NumberValue") local TextLabel = game.StarterGui.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]" end
When you define TextLabel, you need to use the instance in the PlayerGui(on the client.) So through a local script (if placed inside the textlabel) just do
local textLabel = script.Parent
Please be more descriptive with your questions in the future. Though I can see what your problem is based on the title, it is hard for us to get you the help you need to actually fix the problem if we don't know things like...what kind of script it is, where the script is, what you are trying to achieve, etc etc.
You can try to make an IntValue, I always use IntValue to make the game works. Maybe it will like this. You don't need to type so much. I might just help you make the script become not messy so you can maybe find out the answer.
local TimeValue = Instance.new("IntValue") -- maybe try IntValue instead of NumberValue local AM_Or_PM = Instance.new("Part") -- make it find out was the timer is AM or PM local IntValue = Instance.new("IntValue") -- Set this make the AM_Or_PM sets AM_Or_PM TimeValue.Value = 6 -- set the start value --the part properties-- AM_Or_PM.Name = "AM" AM_Or_PM.Transparency = 1 AM_Or_PM.Position = Vector3.new(0,0,0) AM_Or_PM.Anchored = false AM_Or_PM.CanCollide = false AM_Or_PM.Parent = game.Workspace IntValue.Value = 0 --Don't delete those while true do wait(30) if TimeValue.Value > 12 then if IntValue == 0 then AM_Or_PM.Name = "PM" IntValue.Value = 1 TimeValue.Value = 1 else AM_Or_PM.Name = "AM" IntValue.Value = 0 TimeValue.Value = 1 end else TextLabel.Text = "Time:" ..TimeValue.Value..":00".. AM_Or_PM.Name .. "[Day Shift]" TimeValue.Value = TimeValue.Value + 1 end end
Maybe this will help you! My Roblox Studio crashed while I run this script, if you see that doesn't have any errors, please accept my answer :D If it not work, then I hope ya... Happy coding ;D
Closed as Non-Descriptive by User#5423
This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.
Why was this question closed?