Solved GUI Cooldown

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Take!!

Member
Mar 4, 2018
18
3
0
20
so i have a skript with daily rewards, and i want it to update while in the gui, i just have no idea how. i've tried this, but you have to click on it for it to update.
code_language.skript:
on inventory click:
    if inventory name of player's current inventory is "&4&lREWARDS":
        if clicked slot is 20:
            set {_waited} to difference between {dailyrewardscooldown::%uuid of player%} and now
            if {_waited} is less than 1 day:
                set {difference} to "%difference between a day and {_waited}%"
                set slot 20 of current inventory of player to Redstone Block named "&c&lDaily Reward" with lore "&7&m--------------||&e&lRewards:||  &7&l&oDefault:||     &b● &f100 Coins||  &a&l&oWarrior:||     &b● &f135 Coins||  &6&l&oLegend:||     &b● &f175 Coins||  &5&l&oTitan:||     &b● &f200 Coins||  &d&l&oHero:||     &b● &f275 Coins||  &b&l&oDeity:||     &b● &f500 Coins||&7&m--------------||&cYou can claim this reward||&cagain in %{difference}%&c!||&7&m--------------"
                set {dailyrewards::%uuid of player%} to true
                stop
            else:
                delete {dailyrewards::%uuid of player%}
                set slot 20 of current inventory of player to Redstone Block named "&c&lDaily Reward" with lore "&7&m--------------||&e&lRewards:||  &7&l&oDefault:||     &b● &f100 Coins||  &a&l&oWarrior:||     &b● &f135 Coins||  &6&l&oLegend:||     &b● &f175 Coins||  &5&l&oTitan:||     &b● &f200 Coins||  &d&l&oHero:||     &b● &f275 Coins||  &b&l&oDeity:||     &b● &f500 Coins||&7&m--------------||&cYou can claim this reward||&cagain in %{difference}%&c!||&7&m--------------"
                set {dailyrewardscooldown::%uuid of player%} to now
 
code_language.skript:
on inventory click:
    if inventory name of player's current inventory is "&4&lREWARDS":
        if clicked slot is 20:
            set {_waited} to difference between {dailyrewardscooldown::%uuid of player%} and now
            if {_waited} is less than 1 day:
                while player's current inventory is "&4&lREWARDS":
                    set {difference} to "%difference between a day and {_waited}%
                     set slot 20 of current inventory of player to Redstone Block named "&c&lDaily Reward" with lore "&7&m--------------||&e&lRewards:||  &7&l&oDefault:||     &b● &f100 Coins||  &a&l&oWarrior:||     &b● &f135 Coins||  &6&l&oLegend:||     &b● &f175 Coins||  &5&l&oTitan:||     &b● &f200 Coins||  &d&l&oHero:||     &b● &f275 Coins||  &b&l&oDeity:||     &b● &f500 Coins||&7&m--------------||&cYou can claim this reward||&cagain in %{difference}%&c!||&7&m--------------"
                     wait 1 second
                set {dailyrewards::%uuid of player%} to true
            else:
                delete {dailyrewards::%uuid of player%}
                set slot 20 of current inventory of player to Redstone Block named "&c&lDaily Reward" with lore "&7&m--------------||&e&lRewards:||  &7&l&oDefault:||     &b● &f100 Coins||  &a&l&oWarrior:||     &b● &f135 Coins||  &6&l&oLegend:||     &b● &f175 Coins||  &5&l&oTitan:||     &b● &f200 Coins||  &d&l&oHero:||     &b● &f275 Coins||  &b&l&oDeity:||     &b● &f500 Coins||&7&m--------------||&cYou can claim this reward||&cagain in %{difference}%&c!||&7&m--------------"
                set {dailyrewardscooldown::%uuid of player%} to now
 
Last edited:
code_language.skript:
on inventory click:
    if inventory name of player's current inventory is "&4&lREWARDS":
        if clicked slot is 20:
            set {_waited} to difference between {dailyrewardscooldown::%uuid of player%} and now
            if {_waited} is less than 1 day:
                while player's current inventory is "&4&lREWARDS":
                    set {difference} to "%difference between a day and {_waited}%
                     set slot 20 of current inventory of player to Redstone Block named "&c&lDaily Reward" with lore "&7&m--------------||&e&lRewards:||  &7&l&oDefault:||     &b● &f100 Coins||  &a&l&oWarrior:||     &b● &f135 Coins||  &6&l&oLegend:||     &b● &f175 Coins||  &5&l&oTitan:||     &b● &f200 Coins||  &d&l&oHero:||     &b● &f275 Coins||  &b&l&oDeity:||     &b● &f500 Coins||&7&m--------------||&cYou can claim this reward||&cagain in %{difference}%&c!||&7&m--------------"
                     wait 1 second
                set {dailyrewards::%uuid of player%} to true
            else:
                delete {dailyrewards::%uuid of player%}
                set slot 20 of current inventory of player to Redstone Block named "&c&lDaily Reward" with lore "&7&m--------------||&e&lRewards:||  &7&l&oDefault:||     &b● &f100 Coins||  &a&l&oWarrior:||     &b● &f135 Coins||  &6&l&oLegend:||     &b● &f175 Coins||  &5&l&oTitan:||     &b● &f200 Coins||  &d&l&oHero:||     &b● &f275 Coins||  &b&l&oDeity:||     &b● &f500 Coins||&7&m--------------||&cYou can claim this reward||&cagain in %{difference}%&c!||&7&m--------------"
                set {dailyrewardscooldown::%uuid of player%} to now

http://prntscr.com/j9is0n i get this error.
 
change
code_language.skript:
while player's current inventory is "&4&lREWARDS":
to this
code_language.skript:
while name of player's current inventory is "&4&lREWARDS":
 
Status
Not open for further replies.