How would I create a 12AM - 6AM system

This should work:


secondTime = what time it is
hourTime = nil

while true do
      wait(1)
      time += 1
      hourTime = (math.floor(secondTime/(60*60)))
end

i havent tested it though since i dont wanna open up studio

2 Likes

oh and

if hourTime > 6 and < 12 then
      --script
end

or vice versa

1 Like

Can you be more clear with this line? You want a GUI clock or what?

In your second Script, you have a startTime, but it uses tick(), but let me tell you that tick is the time in seconds since 1 January 1970, so can you explain what you did in that line? Because for me, it’s too confusing.

1 Like

wrong, the script basically fetches the game time and displays it, tick() is every second in a roblox game iirc, not unix timestamp

the script will display the time as 06:00 AM if the clock time is 06:00:00 or game time is 6

1 Like

You may see here what tick() is.

1 Like

yeah but that has nothing to do with the script i sent

it does what i said it does, it does NOT display the current # of seconds since 1/1/70

1 Like

But I don’t get like why are you subtracting the no. of seconds from the tick()? Like tick() is a huge no. so subtracting from it doesn’t make any sense to me atleast. That’s why I asked for a clear explaination so I learn about what you did.

1 Like

what is your point dude?

it works fine, test it if you want to

1 Like

This is what I’m trying to say.

1 Like

I didn’t mean that the script would show that time. I’m not that dumb. I mean why you added tick()? It is the no. of seconds since 1/1/1970

1 Like

How is tick() a huge no? if anything this is the most efficient way to make the clock system work.

1 Like


Read the post before you reply to it buddy.

1 Like

So you should atleast give credits. Also you should atleast know what is the script doing rather than just posting :slight_smile:

Btw tick() is a huge no. because it’s literally the no. of seconds since 1/1/1970, I even linked a post about it above.

(Don’t think I got toxic buddy. I’m just here to learn new things and help people.)

1 Like
  1. I do not know where I got it from, just that it is off of devforum
  2. I literally know exactly what the script does, you have web developer in your title so im assuming you know little to nothing about specific roblox coding, i told you what it does

and before you question, i have 2y of experience

1 Like

Hmm, if you are really 2 years experienced, then you should have known that what exactly tick() is. And it will be really good for “beginners” like me if you explain that specific line of code. Like what you did exactly there. See I’m not here to fight but to learn.

1 Like

I’m sorry to tell you, but Moneypro456789 is correct, and you are incorrect.

1 Like

Ok, finally you got the point of what I’m trying to say.

who are you dude? Do I need to make a test place to visualise what it does? because you are disproving yourself.

in fact it seems like Im going to have to do that because you dont have the mental capacity to understand what Im saying.

No, you appear to have misunderstood the functionality of tick(). Please read a documentation before going into a forum and bragging about your “2 years” of experience, it’s not even a lot.

1 Like