SycroX Posted January 6, 2017 Share Posted January 6, 2017 (edited) i have a problem with function getTime .. i want to get the night time and the night time is starting in 20 and end in 6 when i cheak if the time between 20 and 6 i dosen't work , no debugs nothing but if i cheak if time between 20 and 23 it's work why ? local h, m = getTime() if tonumber(h) >= 20 and tonumber(h) < 6 then Edited January 6, 2017 by #Skrillex Link to comment
ViRuZGamiing Posted January 6, 2017 Share Posted January 6, 2017 Well this is quite logically. You're looking for your if-statement to be true. But it'll never be. Example you're number is 5. Then you are indeed below 6. But you aren't above or at 20. There is no existing number that's bigger than 20 but ALSO smaller than six. I do understand that you were thinking in hours instead of numbers. Change the and with an or if tonumber(h) >= 20 or tonumber(h) < 6 then 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now