Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would i make a player wait a 24 hours before they can apply again?

Asked by 5 years ago
Edited 5 years ago

I made an application center for my friends group and i was wondering how to make the player wait 24 hours before they can apply again?

I have tried datastore but nothing comes to mind.

some of you may say "tHiS iS nOt aN rEqUeSt SiTe?"

I'm just curios and would like to know the script behind this, and i have tried scripting this.

1 answer

Log in to vote
2
Answered by 5 years ago
Edited 5 years ago

you can do something like this:

1local canApply = 1
2 
3--Your Code to do something here
4canApply = 0
5 
6    If canApply = 0 then
7        print("You can only apply 1 time per day")
8    wait(86400)
9    canApply = 1

Or you could do a method using os.date(Day) Put an IntValue in your script, i called mine Day

I recommend this more than the other

01local Day = script.Day
02local DayValue = os.date("!*t") ["day"]
03 
04if os.date("!*t") ["day"] == Day.Value then
05    print("You cant apply twice per day!")
06else
07        print('SUCCESS')
08        --Code
09        Day.Value = DayValue
10end

Replace the print("SUCCESS") with your code that makes the application work and replace print('You cant apply twice per day!') with the message or whatever you want to show the person that they are not allowed to apply twice per day

0
YOU ARE SO SMART OMG maxpax2009 340 — 5y
0
np AmIOriginalOrNot 105 — 5y
Ad

Answer this question