jov8486

/daily command that opens a INVENTORY GUI with 7 different minecart with chests, every day, when u use /daily u claim a daily voucher, on the 3rd day you get 2, on the 7th day u get 3

Kodari AI
KodariJul 26 at 8:22 am 5
DailyVoucherRewards
A daily streak reward system that opens an inventory GUI through the /daily command. Players receive one voucher on normal reward days, two vouchers on day three, and three vouchers on day seven. The seven-day streak uses uniquely named chest minecart icons, prevents duplicate claims within 24 hours, resets missed streaks after two days, and automatically cycles back to day one after the seventh reward.

Place daily_vouchers.sk in plugins/Skript/scripts/, then run /sk reload daily_vouchers.

jov8486

errors

๐Ÿ“Ž 1 file 4,705 chars
๐Ÿ“„
pasted-code-1785054549086.txt
txt 155 lines
โ–ถ
Line 107: (daily.sk)
[08:28:57]
    chest named "&aDay %{_daynum}% &8[&aClaimed&8]" is not an nbt compound
[08:28:57]
    Line: set {_item} to minecart with chest named "&aDay %{_daynum}% &8[&aClaimed&8]" with lore "&7You already claimed this reward!", ""
[08:28:57]
 
[08:28:57]
Line 112: (daily.sk)
[08:28:57]
    chest named "&eDay %{_daynum}% &8[&6Available&8]" is not an nbt compound
[08:28:57]
    Line: set {_item} to minecart with chest named "&eDay %{_daynum}% &8[&6Available&8]" with lore "&7Click to claim!", ""
[08:28:57]
 
[08:28:57]
Line 114: (daily.sk)
[08:28:57]
    chest named "&aDay %{_daynum}% &8[&aClaimed&8]" is not an nbt compound
[08:28:57]
    Line: set {_item} to minecart with chest named "&aDay %{_daynum}% &8[&aClaimed&8]" with lore "&7You already claimed this reward!", ""
[08:28:57]
 
[08:28:57]
Line 116: (daily.sk)
[08:28:57]
    chest named "&cDay %{_daynum}% &8[&cLocked&8]" is not an nbt compound
[08:28:57]
    Line: set {_item} to minecart with chest named "&cDay %{_daynum}% &8[&cLocked&8]" with lore "&7Complete previous days first!", ""
[08:28:57]
 
[08:28:57]
Line 149: (daily.sk)
[08:28:57]
    Can't understand this condition/effect: open daily menu to {_p}
[08:28:57]
    Line: open daily menu to {_p}
[08:28:57]
 
[08:28:57]
Line 37: (daily.sk)
[08:28:57]
    Can't understand this condition/effect: open daily menu to player
[08:28:57]
    Line: open daily menu to player
[08:28:57]
 
[08:28:57]
Line 10: (daily.sk)
[08:28:57]
    Can't understand this condition/effect: set date format of {_d} to "yyyy-MM-dd"
[08:28:57]
    Line: set date format of {_d} to "yyyy-MM-dd"
[08:28:57]
 
[08:28:57]
Line 17: (daily.sk)
[08:28:57]
    Can't understand this condition/effect: set date format of {_d} to "yyyy-MM-dd"
[08:28:57]
    Line: set date format of {_d} to "yyyy-MM-dd"
[08:28:57]
 
[08:28:57]
Line 20: (daily.sk)
[08:28:57]
    Can't understand this condition/effect: console "&8[&6Daily&8]&r &aDaily voucher system loaded!"
[08:28:57]
    Line: console "{@prefix} &aDaily voucher system loaded!"
[08:28:57]
 
[08:28:57]
Line 25: (daily.sk)
[08:28:57]
    Can't understand this condition/effect: set date format of {_d} to "yyyy-MM-dd"
[08:28:57]
    Line: set date format of {_d} to "yyyy-MM-dd"
[08:28:57]
 
[08:28:57]
Line 31: (daily.sk)
[08:28:57]
    Can't understand this condition/effect: console "&8[&6Daily&8]&r &aDaily streaks reset for new day!"
[08:28:57]
    Line: console "{@prefix} &aDaily streaks reset for new day!"
[08:28:57]
 
[08:28:57]
Line 41: (daily.sk)
[08:28:57]
    Can't compare 'inventory name' with a text
[08:28:57]
    Line: inventory name is "{@gui_name}"
[08:28:57]
 
[08:28:57]
Line 57: (daily.sk)
[08:28:57]
    Can't understand this condition/effect: set date format of {_today} to "yyyy-MM-dd"
[08:28:57]
    Line: set date format of {_today} to "yyyy-MM-dd"
[08:28:57]
 
[08:28:57]
Line 78: (daily.sk)
[08:28:57]
    Can't understand this expression: {_vouchers} > 1 ? "s" : ""
[08:28:57]
    Line: send "{@prefix} &aYou claimed day %{_slot}%+1's reward! (&e%{_vouchers}% voucher%{_vouchers} > 1 ? "s" : ""%&a)" to player
[08:28:57]
 
[08:28:57]
Line 81: (daily.sk)
[08:28:57]
    Can't understand this condition/effect: open daily menu to player with 1 tick delay
[08:28:57]
    Line: open daily menu to player with 1 tick delay
[08:28:57]
 
[08:28:57]
Line 135: (daily.sk)
[08:28:57]
    chest named "&aDay %{_daynum}% &8[&aClaimed&8]" is not an nbt compound
[08:28:57]
    Line: set {_item} to minecart with chest named "&aDay %{_daynum}% &8[&aClaimed&8]" with lore "&7You already claimed this reward!", ""
[08:28:57]
 
[08:28:57]
Line 139: (daily.sk)
[08:28:57]
    chest named "&eDay %{_daynum}% &8[&6Available&8]" is not an nbt compound
[08:28:57]
    Line: set {_item} to minecart with chest named "&eDay %{_daynum}% &8[&6Available&8]" with lore "&7Click to claim!", ""
[08:28:57]
 
[08:28:57]
Line 141: (daily.sk)
[08:28:57]
    chest named "&aDay %{_daynum}% &8[&aClaimed&8]" is not an nbt compound
[08:28:57]
    Line: set {_item} to minecart with chest named "&aDay %{_daynum}% &8[&aClaimed&8]" with lore "&7You already claimed this reward!", ""
[08:28:57]
 
[08:28:57]
Line 143: (daily.sk)
[08:28:57]
    chest named "&cDay %{_daynum}% &8[&cLocked&8]" is not an nbt compound
[08:28:57]
    Line: set {_item} to minecart with chest named "&cDay %{_daynum}% &8[&cLocked&8]" with lore "&7Complete previous days first!", ""
[08:28:57]
 
[08:28:57]
[Daily] Daily voucher system loaded!
[08:28:57]
    Encountered 19 errors while reloading daily.sk! (133ms)
Kodari AI
KodariJul 26 at 8:35 am 12

Replaced the unsupported date formatting, GUI function, console syntax, title comparison, ternary expression, and minecart item syntax. Use this as daily.sk and remove the old daily script first to avoid duplicate /daily commands.

Place it in plugins/Skript/scripts/daily.sk, delete or rename the old duplicate file, then run:

Plain Text
/sk reload daily
Kodari can make mistakes. Review important code before using.
Files
daily_vouchers.sk
Code
1 130
daily_vouchers.sk
options:
    gui-title: "&8Daily Voucher Rewards"
    voucher-name: "&6Daily Voucher"
    voucher-lore: "&7Redeem this voucher for a daily reward."

command /daily:
    description: Opens the daily voucher rewards menu.
    trigger:
        set {_uuid} to uuid of player
        set {_next-day} to 1

        if {daily.streak::%{_uuid}%} is set:
            set {_next-day} to {daily.streak::%{_uuid}%} + 1
            if {_next-day} is greater than 7:
                set {_next-day} to 1

        if {daily.last-claim::%{_uuid}%} is set:
            set {_elapsed} to difference between now and {daily.last-claim::%{_uuid}%}
            if {_elapsed} is greater than 2 days:
                set {_next-day} to 1

        set {daily.gui::%{_uuid}%} to true
        open chest inventory with 3 rows named "{@gui-title}" to player

        set slot 10 of player's current inventory to chest minecart named "&cDay 1 &8[Locked]" with lore "&7Reward: &f1 voucher" and "&8Claim the previous day first"
        set slot 11 of player's current inventory to chest minecart named "&cDay 2 &8[Locked]" with lore "&7Reward: &f1 voucher" and "&8Claim the previous day first"
        set slot 12 of player's current inventory to chest minecart named "&cDay 3 &8[Locked]" with lore "&7Reward: &f2 vouchers" and "&8Claim the previous day first"
        set slot 13 of player's current inventory to chest minecart named "&cDay 4 &8[Locked]" with lore "&7Reward: &f1 voucher" and "&8Claim the previous day first"
        set slot 14 of player's current inventory to chest minecart named "&cDay 5 &8[Locked]" with lore "&7Reward: &f1 voucher" and "&8Claim the previous day first"
        set slot 15 of player's current inventory to chest minecart named "&cDay 6 &8[Locked]" with lore "&7Reward: &f1 voucher" and "&8Claim the previous day first"
        set slot 16 of player's current inventory to chest minecart named "&cDay 7 &8[Locked]" with lore "&7Reward: &f3 vouchers" and "&8Claim the previous day first"

        if {_next-day} is 1:
            set slot 10 of player's current inventory to chest minecart named "&eDay 1 &8[Available]" with lore "&7Reward: &f1 voucher" and "&aClick to claim"
        else if {_next-day} is 2:
            set slot 11 of player's current inventory to chest minecart named "&eDay 2 &8[Available]" with lore "&7Reward: &f1 voucher" and "&aClick to claim"
        else if {_next-day} is 3:
            set slot 12 of player's current inventory to chest minecart named "&eDay 3 &8[Available]" with lore "&7Reward: &f2 vouchers" and "&aClick to claim"
        else if {_next-day} is 4:
            set slot 13 of player's current inventory to chest minecart named "&eDay 4 &8[Available]" with lore "&7Reward: &f1 voucher" and "&aClick to claim"
        else if {_next-day} is 5:
            set slot 14 of player's current inventory to chest minecart named "&eDay 5 &8[Available]" with lore "&7Reward: &f1 voucher" and "&aClick to claim"
        else if {_next-day} is 6:
            set slot 15 of player's current inventory to chest minecart named "&eDay 6 &8[Available]" with lore "&7Reward: &f1 voucher" and "&aClick to claim"
        else if {_next-day} is 7:
            set slot 16 of player's current inventory to chest minecart named "&eDay 7 &8[Available]" with lore "&7Reward: &f3 vouchers" and "&aClick to claim"

on inventory click:
    set {_uuid} to uuid of player

    if {daily.gui::%{_uuid}%} is not true:
        stop

    cancel event

    if clicked slot is 10:
        set {_clicked-day} to 1
    else if clicked slot is 11:
        set {_clicked-day} to 2
    else if clicked slot is 12:
        set {_clicked-day} to 3
    else if clicked slot is 13:
        set {_clicked-day} to 4
    else if clicked slot is 14:
        set {_clicked-day} to 5
    else if clicked slot is 15:
        set {_clicked-day} to 6
    else if clicked slot is 16:
        set {_clicked-day} to 7
    else:
        stop

    set {_next-day} to 1

    if {daily.last-claim::%{_uuid}%} is set:
        set {_elapsed} to difference between now and {daily.last-claim::%{_uuid}%}

        if {_elapsed} is less than 1 day:
            send "&cYou have already claimed today's voucher." to player
            stop

        if {_elapsed} is greater than 2 days:
            set {daily.streak::%{_uuid}%} to 0

    if {daily.streak::%{_uuid}%} is set:
        set {_next-day} to {daily.streak::%{_uuid}%} + 1

    if {_next-day} is greater than 7:
        set {_next-day} to 1

    if {_clicked-day} is not {_next-day}:
        send "&eYou must claim Day %{_next-day}%&e's reward." to player
        stop

    set {_amount} to 1

    if {_clicked-day} is 3:
        set {_amount} to 2
    else if {_clicked-day} is 7:
        set {_amount} to 3

    set {daily.streak::%{_uuid}%} to {_clicked-day}
    set {daily.last-claim::%{_uuid}%} to now

    give {_amount} of paper named "{@voucher-name}" with lore "{@voucher-lore}" to player

    if {_amount} is 1:
        send "&aYou claimed &f1 &adaily voucher!" to player
    else:
        send "&aYou claimed &f%{_amount}% &adaily vouchers!" to player

    delete {daily.gui::%{_uuid}%}
    close player's inventory

on inventory drag:
    set {_uuid} to uuid of player

    if {daily.gui::%{_uuid}%} is true:
        cancel event

on inventory close:
    set {_uuid} to uuid of player
    delete {daily.gui::%{_uuid}%}

on quit:
    set {_uuid} to uuid of player
    delete {daily.gui::%{_uuid}%}

on script load:
    send "&aDaily voucher system loaded successfully." to console