Hello everyone. So I'm making a ban gui, that uses date as a source to define how long players are banned for. I have a script for it, that supposedly checks if a date is higher than another. And if so the player gets kicked for being banned because the date is still not right. But it doesn't work. Here's the code:
Let's say DayD, MonthD and YearD are respectively 1 5 2019 as today's date
And let's say DayP, MonthP and YearP are respectively 16 8 2019 as the date the player is banned until
How would I correct this code to work properly?
if YearD <= YearP then --Still banned
game.Players:FindFirstChild(tostring(PlayerWhoJoined)):Kick("You are banned.")
else --Year is good, check month!
if MonthD <= MonthP then --Still banned
game.Players:FindFirstChild(tostring(PlayerWhoJoined)):Kick("You are banned.")
else --Month is good, check day!
if DayD <= DayP then --Still banned
game.Players:FindFirstChild(tostring(PlayerWhoJoined)):Kick("You are banned.")
else--Player is good, and will get unbanned.
--Unban player code here
**Thank you very much to those who try to help! **

1 comment
What an amazing question !!!!!! UPVOTE THIS PLS (I am writing an answer currently)