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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

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

Solved Problem with function if

Discussion in 'Skript' started by wCrazy_, Oct 26, 2021.

Thread Status:
Not open for further replies.
  1. wCrazy_

    wCrazy_ Member

    Joined:
    Jan 7, 2021
    Messages:
    15
    Likes Received:
    0
    Version of server: Spigot-1.8.8
    Version of skript: v2.1.2

    Hi how can i fix this:

    Code (Text):
    1. every 1 second:
    2.     set {_unix-time.reward.all} to convert date now to unix date
    3.     send "%{_unix-time.reward.all}%" to console
    4.     loop all players:
    5.         loop {Rewards.%loop-player%::*}:
    6.             send "%loop-player%: %loop-value%" to console
    7.             if {Rewards.%loop-player%::%loop-value%} is {_unix-time.reward.all}: #this not working
    8.                 set {canClaim.reward.%loop-player%.%loop-value%} to true
    9.                 send "&fPlayer &c%loop-player% &fcan claim &c%loop-value% &freward. ok worked every 1 sec" to console
    --- Double Post Merged, Oct 26, 2021, Original Post Date: Oct 26, 2021 ---
    and "{Rewards.%loop-player%::%loop-value%}" is:

    Code (Text):
    1. set {_unix-time2.reward.%player%} to {_time.reward.%player%.%{claim.reward.%player%}%} + {_unix-time.reward.%player%.%{claim.reward.%player%}%}
    2. set {Rewards.%player%::%{claim.reward.%player%}%} to {_unix-time2.reward.%player%}
     
  2. Minecoll_YT

    Supporter Forums Helper

    Joined:
    Dec 2, 2018
    Messages:
    650
    Likes Received:
    39
    Where is the problem? And "every 1 second" .. idk man
     
  3. wCrazy_

    wCrazy_ Member

    Joined:
    Jan 7, 2021
    Messages:
    15
    Likes Received:
    0
    I found bug.

    How can i set {canClaim.reward.%loop-player%.%loop-value%} to true


    Code (Text):
    1.             if loop-value is {_unix-time.reward.all}:
    2.                 set {canClaim.reward.%loop-player%.%loop-value%} to true #this not work now
    3.                 send "&fPlayer &c%loop-player% &fcan claim &c%loop-value% &freward. ok worked every 1 sec" to console
    4.                 stop
    --- Double Post Merged, Oct 26, 2021, Original Post Date: Oct 26, 2021 ---
    loop-value is unixcode
     
Thread Status:
Not open for further replies.

Share This Page

Loading...