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 4 years ago
Edited 4 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 4 years ago
Edited 4 years ago

you can do something like this:

local canApply = 1 

--Your Code to do something here
canApply = 0

    If canApply = 0 then
        print("You can only apply 1 time per day")
    wait(86400)
    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

local Day = script.Day
local DayValue = os.date("!*t") ["day"]

if os.date("!*t") ["day"] == Day.Value then
    print("You cant apply twice per day!")
else
        print('SUCCESS')
        --Code
        Day.Value = DayValue
end

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 — 4y
0
np AmIOriginalOrNot 105 — 4y
Ad

Answer this question