Solved Difference between (not working)

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

Wynandus

Member
Aug 23, 2017
15
0
0
24
Could anyone help me with this problem? Its just completely not working and i don't know what i am doining wrong... Here's my code.
code_language.skript:
        if arg-1 is "claim":
            if {server.waited.%uuid of player%} is set:
                if {server.waited.%uuid of player%} is more than 24 hours:
                    set {server.waited.%uuid of player%} to now
                    make console execute command "/tokens give %player% 15"
                    make console execute command "/crate give v Ice 1 %player%"
                    message "{@prefix} {@claimed_dailyreward}"
                else:
                    message "{@prefix} {@cooldowntime}"
                    stop
            else:
                set {server.waited.%uuid of player%} to difference between {server.delivery.%player%.lastused} and now
                set {server.waited.%player%} to now
                make console execute command "/tokens give %player% 15"
                make console execute command "/crate give v Ice 1 %player%"
                message "{@prefix} {@claimed_dailyreward}"
I changed the code a bit to make a bit more clear, so basicly i can claim the reward unlimited amount of times and the cooldown does not work..
 
Last edited:
Please be more specific when making a help thread, we're not exactly mind readers so if you don't tell us what is not working from that script, no one will be able to help you properly.

So, from a fast look to the script, there are some suggestions that may not fix it but I totally encourage following:
1. Don't use format slot, it is completely discouraged and known to be buggy, the vanilla Skript solution is set slot + the inventory click event.
2. Use list variables (those separated by two colons), it'll make your life easier.
3. Use the else statement, you're pointlessly checking whether one of the argument is sent and then the contrary condition when you could just do:
code_language.skript:
if arg-1 is set:
  # do stuff
else:
  # do other stuff
 
Still need help, changed the thread to make it a bit more clear.
[doublepost=1541455972,1541433953][/doublepost]I have found the solution.
 
Status
Not open for further replies.