1. 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!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Daily Login Streak

Discussion in 'Requests' started by Cupex, Sep 23, 2021.

  1. Cupex

    Cupex Member

    Joined:
    Feb 16, 2020
    Messages:
    34
    Likes Received:
    1
    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
     
  2. WeakBrainStorm

    WeakBrainStorm New Member

    Joined:
    Sep 2, 2021
    Messages:
    9
    Likes Received:
    0
    This should work

    Code (Text):
    1. on first join:
    2.     {time::enough::streak::%player%} to 3
    3.     set {time::daily::%player%} to 0
    4.  
    5. every hour:
    6.     loop all offline players:
    7.             add 1 to {time::daily::%loop-player%}
    8.  
    9. on join:
    10.     if {time::daily::%player%} is not set:
    11.         set {time::daily::%player%} to 0
    12.     if {time::daily::%player%} is => 48:
    13.         set {time::daily::%player%} to 0
    14.         set {time::streak::%player%} to 0
    15.          set {time::enough::streak::%player%} to 3
    16.  
    17.  
    18. command /streak:
    19.     trigger:
    20.         if {time::daily::%player%} => 24:
    21.             set {time::daily::%player%} to 0
    22.             add 1 to {time::streak::%player%}
    23.             send "You'r message here" to player
    24.         else:
    25.             send "You'r message here" to player
    26.         if {time::streak::%player%} is {time::enough::streak::%player%}:
    27.             send "You'r message here" to player
    28.  
    29.         #idk what works for you so find out an delete one of them
    30.             add 200 to player's balance
    31.             console command "eco give %player% 200"
    32.  
    33.             set {time::enough::streak::%player%} to {time::enough::streak::%player%} * 3
    If there is anything that dosent work please just say so
     
    #2 WeakBrainStorm, Sep 26, 2021
    Last edited: Sep 26, 2021
  3. Cupex

    Cupex Member

    Joined:
    Feb 16, 2020
    Messages:
    34
    Likes Received:
    1
    Can you explain what you did there? So I can understand it better.
     
  4. WeakBrainStorm

    WeakBrainStorm New Member

    Joined:
    Sep 2, 2021
    Messages:
    9
    Likes Received:
    0
    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
     
    #4 WeakBrainStorm, Sep 26, 2021
    Last edited: Sep 26, 2021

Share This Page

Loading...