HELP WITH SCRIPT #315


Open
  • LucyHiromi created this issue Nov 10, 2021

    Hello, i want to do this:

     

    save:
      command: /save
      type: RUN_CONSOLE
      runcmd:
        - '$Script$%if%$arg1==flush'
        #- 'minecraft:save-all flush'
        - "$broadcasttext$&8[&7Server&8] &9(Flushing) Saving all server data. . ."
        - '$Script$%elseif%$arg1==on'
        #- 'execute store success score sucess output saveon run save-on'
        - "$broadcasttext$&8[&7Server&8] &9Saving is on"
        - '$Script$%elseif%$arg1==off'
        #- 'execute store success score sucess output saveoff run save-off'
        - "$broadcasttext$&8[&7Server&8] &cSaving is off."
        - '$Script$%else%'
        #- 'minecraft:save-all'
        - "$broadcasttext$&8[&7Server&8] Saving all server data. . ."
      permission-required: true
      register: true
      tablist:
        1:
         - flush
         - all
         - on
         - off

    It works, but i want to store the result of /save-on and /save-off
    And make a custom message for when it's already enabled or disabled.
    I can make this with execute store success but how can i make it variable to use it in a %if%??

  • LucyHiromi posted a comment Nov 10, 2021

    Also, if using an $arg as a player name, how can i check if it's online?

     

    (Update):

    $Script$%if%$CheckPlayerStatus%$arg2%isOnline%==true

     

    Edited Nov 10, 2021
  • LucyHiromi posted a comment Nov 10, 2021

    And can i target offline players?, obtain the UUID based on given name?

  • LucyHiromi posted a comment Nov 10, 2021

    hOW CAN I KNOW IF COMMAND HAS BEEN GIVEN ARGUMENTS???


To post a comment, please login or register a new account.