This is the current script I’ve got going:
if game.Lighting.ClockTime == “6” then
if game.Lighting.ClockTime == “19” then
Night & Birds are the different audios I have placed into SoundService, I’m most definitely not an individual who scripts very often, if I do, I script very little.
The first issue you’ll find is that ClockTime is a float not a string (get rid of the quotation marks). You also need to encapsulate the functions either in an event or a loop of some sort (RunService or while) so that the if statements don’t run only once.
I appreciate your response, I removed the quotation marks, are you able to give me an example of how I could encapsulate the functions in an event or loop?
-- Your code
This will make your code trigger every time the ClockTime property is changed.
I suggest putting the audios in Baseplate as it needs a reference to play the audio from. I think that, along with connecting it to an event as aforementioned by @StaySpy should help you.
Thank you very much for your response.
I greatly appreciate it as well.
Ah, still encountering some issues, not sure what they are, are you able to give me the full script in which I can just edit the id’s and the clocktime?
local Lighting = game.Lighting
if Lighting.ClockTime == 6 then
print('Its 6 am! Good morning!')
elseif Lighting.ClockTime == 19 then
print('Its Night! Good night.')