Time function doesn't work?

I don’t get it, what’s this “string.sub” code?

1 Like

Dont do it, that would actually then run 3600 times and u dont want that

1 Like

U know what, forget if statement for now and just print TimeOfDay and see what kind of data do u get and if an event actaully fires

1 Like

It’s a serverscript, It’s a simple script, when it’s 6 PM it basically gives them a gui.

I tried this before ^

string.sub("Hello!", 1, 2) would return “He” as they are the first two characters in the string.
It’s useful for making: Typewriter effects on UI, and gathering data from strings.

You could also do:
local output = string.split("18:00:00", ":") to have it divide it into 18, 00 and 00.
Then get ‘18’ by doing local A = output[1].

1 Like

I am telling u to do this:


local Lighting = game:GetService("Lighting")
Lighting:GetPropertyChangedSignal("TimeOfDay"):Connect(function(player)
    print(Lighting.TimeOfDay) 
end

And then utell us what u get

1 Like

Well this worked though, if it doesn’t work for u then its your game error since it works for me

game.Players.PlayerAdded:Wait()

game.Lighting:GetPropertyChangedSignal("TimeOfDay"):Connect(function()
	print("bingo")
	if game.Lighting.TimeOfDay == "18:00:00" then
		print("gorilla is cute")
		end
end)
1 Like

Nothing, no errors or prints, nothing.

Let me try it out.

I’ll inform if it works

Bingo works, but the gorilla string wouldn’t show up at 18:00

Can you show me a video about you changing the time and all
Mainly because it worked for me

1 Like

I use adonis admin to change time, i do :time 17,58 and wait till it hits 18:00 and test it.

do you have a video recorder to show me? Because it might have to do with Client and Server problem

1 Like

Well everytime i record, the file is too big for devforum, pics can only help.

how do you use :time? since I don’t understand what you mean

Admin commands, adonis admin.

and just use :time

Ok then try this, don’t use admin and change the time manually

1 Like

I’ll try it out, i’ll inform you if it worked or not

I think it was the admin after all, because now it worked.

Oh, Knew it. It was because the admin is a local script so the server wouldn’t see it

1 Like