While loop isnt doing anything

This is my script. I’m working on a raise a floppa type of game. In this script I’m trying to make it so the player can collect rent during day but not night. I put a print statement right after the while loop and it didn’t print anything.

Please help.

Okay so, use Lighting:GetPropertySignalChanged() instead of a while loop, and make sure your getminutes after midnights are correct.

https://developer.roblox.com/en-us/api-reference/event/Lighting/LightingChanged

There’s also the lesser known LightingChanged event/signal which is fired when a ‘Lighting’ service property is changed (or a skybox is parented to it).

so like this correct?

woops. just noticed i put “clocktime”

Yes, that would also be ok in terms of the script.

sry for responding so late, I was on vacation. Anyways it didn’t seem to work. But some other part of the team I’m on is working on it. Thank you for helping!