Solved Daily Login Streak

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

Cupex

Member
Feb 16, 2020
43
1
8
26
Category: Login Streak
Suggested name: dailystreak.sk

Spigot/Skript Version: 1.8/2.2-dev25

What I want:
I need a Daily Login Streak Skript where you have to log on to the server 3 times in a row. Then if you reached the 3 days you get for example 100 Coins. The Streak is reseting every 24 hours. So if you dont login due to this time the streak will set to 0 and you begin at the start.

Streaks:
3 days
12 days
36 days
-------------> everytime you get a reward.

Ideas for commands:
/streak

Ideas for permissions:
/


When I'd like it by: tomorrow - Sunday
 
This should work

Code:
on first join:
    {time::enough::streak::%player%} to 3
    set {time::daily::%player%} to 0
 
every hour:
    loop all offline players:
            add 1 to {time::daily::%loop-player%}

on join:
    if {time::daily::%player%} is not set:
        set {time::daily::%player%} to 0
    if {time::daily::%player%} is => 48:
        set {time::daily::%player%} to 0
        set {time::streak::%player%} to 0
         set {time::enough::streak::%player%} to 3


command /streak:
    trigger:
        if {time::daily::%player%} => 24:
            set {time::daily::%player%} to 0
            add 1 to {time::streak::%player%}
            send "You'r message here" to player
        else:
            send "You'r message here" to player
        if {time::streak::%player%} is {time::enough::streak::%player%}:
            send "You'r message here" to player

        #idk what works for you so find out an delete one of them
            add 200 to player's balance
            console command "eco give %player% 200"

            set {time::enough::streak::%player%} to {time::enough::streak::%player%} * 3

If there is anything that dosent work please just say so
 
Last edited:
Can you explain what you did there? So I can understand it better.
Sure!

line 1 to 3:

when you join for the first time it sets the days you need to be online to get a reward withs is three. after it sets the daily time to 0.

line 5 to 7:

loops all the offline players and adds 1 hour

line 9 to 15:

9 to 11:

first IF the daily timer shouldnt have been set already it sets it automatically.

12 to 15:

if the offline time goes over 48 hours ir resets streak and daily login. then it sets the streak needed to 3

line 18 to 33:

18 to 19:

the command

20 to 22:

if offline time is 24 hours or higher it adds 1 to streak and resets daily hour

23:

the message you want to show when the player adds 1 to thier streak

24:

if daily hours is less than 24 hours

25:

the message you want to send if the daily is less than 24 hours

26:

if the streak is the needed streak withs is 3 for the first time

27:

the message you want to send if tthey claimed the streak

30 to 31:

adds 200 money to the players bal. i just dont know what works so just delete one of them

33:

if you claimed your first streak it sets the new streak to (the number of days) * 3. if you want you can set it to + instead of * because it can be allot if you dublicate the time so much

And again if anything dosent work just say what wont work and i will try to fix it
 
Last edited: