Simple IF event 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.

Dovkin

Member
Oct 10, 2018
11
0
0
33
Code:
command /autorank:
    trigger:
        set {_smp} to placeholder "statistic_minutes_played"
        send "%{_smp}%"
        if {_smp} is greater than or equal to 10000:
            execute console command "lp user %player% permission set deluxetags.tag.Citizen"
            execute console command "bbroadcast &bCongratulations! &b%player% has reached 10,000 minutes played and received his new Citizen tag!"
            log "%Player%-Citizen Tag" to "Autorank.Log"

Upon typing the command, it just displays your minutes played in chat, as it should. But the whole IF event isn't processed. Been trying to work this all day, and unsure how it should be done. Thanks!
 
Code:
command /autorank:
    trigger:
        set {_smp} to placeholder "statistic_minutes_played"
        send "%{_smp}%"
        if {_smp} is greater than or equal to 10000:
            execute console command "lp user %player% permission set deluxetags.tag.Citizen"
            execute console command "bbroadcast &bCongratulations! &b%player% has reached 10,000 minutes played and received his new Citizen tag!"
            log "%Player%-Citizen Tag" to "Autorank.Log"

Upon typing the command, it just displays your minutes played in chat, as it should. But the whole IF event isn't processed. Been trying to work this all day, and unsure how it should be done. Thanks!
Try parsing the variable as a number
 
Idk if this works or you already got a solution:


Code:
command /autorank:
    trigger:
        set {_smp} to "statistic_minutes_played"
        send "%{_smp}%"
        if {_smp} is greater than or equal to 10000:
            execute console command "lp user %player% permission set deluxetags.tag.Citizen"
            execute console command "bbroadcast &bCongratulations! &b%player% has reached 10,000 minutes played and received his new Citizen tag!"
            log "%Player%-Citizen Tag" to "Autorank.Log"

Just delete the placeholder word/thing then it will works I THINK.
 
code_language.skript:
[LIST=1]
[*]command /autorank:
[*]    trigger:
[*]        set {_smp} to placeholder "statistic_minutes_played"
[*]        send "%{_smp}%"
[*]        if ({_smp} parsed as a number) is greater than or equal to 10000:
[*]            execute console command "lp user %player% permission set deluxetags.tag.Citizen"
[*]            execute console command "bbroadcast &bCongratulations! &b%player% has reached 10,000 minutes played and received his new Citizen tag!"
[*]            log "%Player%-Citizen Tag" to "Autorank.Log"
[*]I think you need to add placeholder...
[/LIST]
 
Code:
command /autorank:
    trigger:
        set {_smp} to placeholder "statistic_minutes_played"
        send "%{_smp}%"
        if {_smp} is greater than or equal to 10000:
            execute console command "lp user %player% permission set deluxetags.tag.Citizen"
            execute console command "bbroadcast &bCongratulations! &b%player% has reached 10,000 minutes played and received his new Citizen tag!"
            log "%Player%-Citizen Tag" to "Autorank.Log"

Upon typing the command, it just displays your minutes played in chat, as it should. But the whole IF event isn't processed. Been trying to work this all day, and unsure how it should be done. Thanks!
Try:
code_language.skript:
set {_placeholder.min.played} to placeholder "statistic_minutes_played"
set {_smp} to "%{_placeholder.min.played}%" parsed as integer
 
Status
Not open for further replies.