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 Reseting Prison Mines

Discussion in 'Skript' started by FlameikTV, May 22, 2020.

  1. FlameikTV

    FlameikTV Member

    Joined:
    May 22, 2020
    Messages:
    4
    Likes Received:
    0
    Hi,
    I want to reset my mines with skript but I don't want to reset mine by coordinates like in this topic..

    My friend has told me that it is possible to loop all blocks in WorldGuard region and test if it is 0 - fill it and if it is (for example as block in current mine) 1 - don't fill it..

    Do you somebody know how to do it?
    Thank you very much for any help. :emoji_slight_smile:

    and sorry for my poor english..
    --- Double Post Merged, May 22, 2020, Original Post Date: May 22, 2020 ---
    I have solved this with schematic and placing it through console, but i need to run that command every day at 12AM, how can i do it? Thanks for any help..

     
  2. Best Answer:
    Post #4 by Dave, May 23, 2020
  3. Viktor Tim Aggerholm

    Supporter

    Joined:
    Dec 29, 2019
    Messages:
    182
    Likes Received:
    12
    Do you use a mc host, to host your server?
    --- Double Post Merged, May 22, 2020, Original Post Date: May 22, 2020 ---
    if so, they most likely has a commands section, in which you can make commands that are automatically run
     
  4. FlameikTV

    FlameikTV Member

    Joined:
    May 22, 2020
    Messages:
    4
    Likes Received:
    0
    No, I am using Fakaheda.eu its Czech hosting, they don't have anything like timed commands and so on..
    --- Double Post Merged, May 22, 2020, Original Post Date: May 22, 2020 ---
    Maybe it'll need some external java plugin to do it, because from skript i now only time variable %now% but it is not good for my prupose.
     
  5. Dave

    Dave Well-Known Member

    Joined:
    Jul 20, 2018
    Messages:
    140
    Likes Received:
    4
    Requires: Skellet
    Code (Text):
    1. command /mine [<text>] [<int>]:
    2.     permission message: &cNo permissions.
    3.     executable by: players
    4.     permission: rank.admin
    5.     trigger:
    6.         if arg-1 is set:
    7.             if arg-1 is "set" or "corner" or "pos":
    8.                 if arg-2 is set:
    9.                     if arg-2 is 1 or 2:
    10.                         set {mine.coner%arg-2%} to player's location
    11.                         send "&aYou have set the corner &f%{mine.coner%arg-2%}% &afor &fprison_mine&a."
    12.                     else:
    13.                         send "&cIncorrect usage."
    14.                 else:
    15.                     send "&cIncorrect usage."
    16.  
    17.             else if arg-1 is "save" or "create":
    18.                 if arg-2 is not set:
    19.                     if {mine.coner1} is set:
    20.                         if {mine.coner2} is set:
    21.                             create a regenerator with ID "prison_mine" from {mine.coner1} to {mine.coner2}
    22.                             delete {mine.coner1} and {mine.coner2}
    23.                         else:
    24.                             send "&cMissing the 2nd corner for regenerator."
    25.                     else:
    26.                         send "&cMissing the 1st corner for regenerator."
    27.                 else:
    28.                     send "&cIncorrect usage."
    29.  
    30.             else if arg-1 is "delete" or "remove":
    31.                 if arg-2 is not set:
    32.                     loop all regenerator ids:
    33.                         if loop-value is "prison_mine":
    34.                             delete regenerator with ID "prison_mine"
    35.                             send "&cYou have deleted the regenerator &fprison_mine&c."
    36.                             delete {mine.coner1} and {mine.coner2}
    37.                         else:
    38.                             send "&cThere is no a regenerator."
    39.                 else:
    40.                     send "&cIncorrect usage."
    41.  
    42.             else if arg-1 is "reset" or "regen":
    43.                 if arg-2 is not set:
    44.                     loop all regenerator ids:
    45.                         if loop-value is "prison_mine":
    46.                             regenerate regenerator with ID "prison_mine"
    47.                             send "&fprison_mine &ahave been reset."
    48.                         else:
    49.                             send "&cThere is no a regenerator."
    50.                 else:
    51.                     send "&cIncorrect usage."
    52.             else:
    53.                 send "&cUsage: /mine <set | save | reset | delete> <corner>"
    54.         else:
    55.             send "&cUsage: /mine <set | save | reset | delete> <corner>"
    56.  
    57. on skript load:
    58.     regenerate regenerator with ID "prison_mine"
    59.     send "[Prison] &aThe mine have been reset." to console
    60.  
    61. every 12 hours:
    62.     regenerate regenerator with ID "prison_mine"
    63.     broadcast "[Prison] &aThe mine have been reset."
     
  6. FlameikTV

    FlameikTV Member

    Joined:
    May 22, 2020
    Messages:
    4
    Likes Received:
    0
    I'll try it and write back, thank you :emoji_slight_smile:
     
  7. Dave

    Dave Well-Known Member

    Joined:
    Jul 20, 2018
    Messages:
    140
    Likes Received:
    4
    Alright, if it works, mark as best answer : )
     
  8. FlameikTV

    FlameikTV Member

    Joined:
    May 22, 2020
    Messages:
    4
    Likes Received:
    0
    I have doned that with schematics and pasting them by console and using //world command, but your code may work too, thank you wery much :emoji_slight_smile:
     
  9. Dave

    Dave Well-Known Member

    Joined:
    Jul 20, 2018
    Messages:
    140
    Likes Received:
    4
    I tried pasting schematics, too, but I tried with regenerators based on ID's and it works faster without any lag in my opinion.
     
Loading...