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 I'm running in a problem deleting homes

Discussion in 'Skript' started by Jayden13O, Jun 9, 2021.

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

    Jayden13O Member

    Joined:
    Jun 9, 2021
    Messages:
    22
    Likes Received:
    1
    Skript version: custom minehut version.
    Minecraft version: 1.16.5

    The problem in my code i'm running into is when using '/homeremove13o all' it does correctly delete all homes, but if i do '/homeremove13o home', it wont do anything.
    Does anyone have any advice on getting it to work? Here is my full code:
    Code (Text):
    1. command /sethome13O <text>:
    2.     trigger:
    3.         if {homes.%player's UUID%::*} does not contain argument 1:
    4.             add argument 1 to {homes.%player's UUID%::*}
    5.             set {homes.%player's UUID%::%argument 1%.location} to player's location
    6.             send "<green>[13O] Home %argument 1%<green> made at %player's location%!<green>" to player
    7.         else:
    8.             send "<red>[13O] Home %argument 1%<red> already exists, pick another name" to player
    9.  
    10. command /homelist13O:
    11.     trigger:
    12.         send {homes.%player's UUID%::*} to player
    13.         send "[13O] If you received no home names, you own no homes"
    14.  
    15. command /home13O <text>:
    16.     trigger:
    17.         if {homes.%player's UUID%::*} contains argument 1:
    18.             teleport player to {homes.%player's UUID%::%argument 1%.location}
    19.             send "woosh" to player
    20.         else:
    21.             send "<red>[13O] Home %argument 1%<red> does not exist, check for proper spelling" to player
    22.  
    23. command /homeremove13O <text>:
    24.     trigger:
    25.         if argument 1 is "all":
    26.             delete {homes.%player's UUID%::*}
    27.             send "<green>[13O] Deleted <red>ALL YOUR HOMES<green>!"
    28.         else if {homes.%player's UUID%::*} contains argument 1:
    29.             send "<red>[13O] Deleting home %argument 1%<red>!"
    30.             delete {homes.%player's UUID%::%argument 1%}
    31.         else:
    32.             send "<red>[13O] Home %argument 1%<red> does not exist! Please check for proper spelling! If you try to delete all homes type 'all'!"


     
  2. Best Answer:
    Post #4 by Minecoll_YT, Jun 13, 2021
  3. Minecoll_YT

    Supporter Forums Helper

    Joined:
    Dec 2, 2018
    Messages:
    650
    Likes Received:
    39
    why are you using multiple variables??
     
    • Like Like x 1
  4. Jayden13O

    Jayden13O Member

    Joined:
    Jun 9, 2021
    Messages:
    22
    Likes Received:
    1
    I don't really understand your question but i'm trying to have multiple homes, hope you ment that.
    If it helps this is the line that doesn't work as intended but gives no errors:
    Code (Text):
    1.             delete {homes.%player's UUID%::%argument 1%}
    And also, i'm seeing you everywhere on the forums helping people! Thank you for that! Free like from me.
     
  5. Minecoll_YT

    Supporter Forums Helper

    Joined:
    Dec 2, 2018
    Messages:
    650
    Likes Received:
    39
    I re-skript that for you, give me a second
    --- Double Post Merged, Jun 13, 2021, Original Post Date: Jun 13, 2021 ---
    sry had some trouble finding smth out
    Code (Text):
    1. command /home13O [<text>]:
    2.   trigger:
    3.     if arg-1 is set:
    4.       loop {homes::%player's UUID%::*}:
    5.         add loop-index to {_homes::*}
    6.       if {_homes::*} contains arg-1:
    7.         teleport player to {homes::%player's UUID%::%arg-1%}
    8.         send "woosh" to player
    9.       else:
    10.         send "<red>[13O] Home ""%arg-1%""<red> does not exist, check for proper spelling" to player
    11.     else:
    12.       send "<red>[13O] You have to provide a proper name for the home you want to delete"
    13.  
    14. command /homeremove13O [<text>]:
    15.   trigger:
    16.     if arg-1 is not set:
    17.       send "<green>[13O] You have to provide a name or use ""all"" to delete all of your homes."
    18.     else:
    19.       if arg-1 is "all":
    20.         delete {homes::%player's uuid%::*}
    21.         send "<green>[13O] Deleted <red>ALL YOUR HOMES<green>!"
    22.         stop
    23.       else:
    24.         loop {homes::%player's UUID%::*}:
    25.         add loop-index to {_homes::*}    
    26.         if {_homes::*} contains arg-1:
    27.           send "<red>[13O] Deleting home %arg-1%<red>!"
    28.           delete {homes::%player's uuid%::%arg-1%}
    29.         else:
    30.           send "<red>[13O] Home %arg-1%<red> does not exist! Please check for proper spelling! If you try to delete all homes type 'all'!"
    31.  
    32. command /sethome13O [<text>]:
    33.   trigger:
    34.     if arg-1 is set:
    35.       loop {homes::%player's UUID%::*}:
    36.         add loop-index to {_homes::*}
    37.       if {_homes::*} does not contain arg-1:
    38.         set {homes::%player's uuid%::%arg-1%} to location of player
    39.         send "<green>[13O] Home %arg-1%<green> made at %player's location%!<green>" to player
    40.       else:
    41.         send "<red>[13O] Home %arg-1%<red> already exists, pick another name or delete it"
    42.     else:
    43.       send "&c[13O] You have to provide a proper name for your home e.g.: /sethome13O myhome"
    44.  
    45. command /homelist13O [<text>]:
    46.   trigger:
    47.     set {_homes::*} to {homes::%player's uuid%::*}
    48.     if {_homes::*} is not set:
    49.       send "<red> [13O] You don't have any homes set"
    50.     else:
    51.       loop {homes::%player's uuid%::*}:
    52.         add loop-index to {_x::*}
    53.       send "<green>[13O] Your homes: %{_x::*}%"
     
    • Like Like x 1
  6. Jayden13O

    Jayden13O Member

    Joined:
    Jun 9, 2021
    Messages:
    22
    Likes Received:
    1
    Thank you for re-skripting, i fixed some tiny problems with your code and it works perfectly!
    I'm going to set this thread to solved.

    For if someone wants the slightly fixed code
    Code (Text):
    1. command /homeremove13O [<text>]:
    2.   trigger:
    3.     if arg-1 is not set:
    4.       send "<green>[13O] You have to provide a name or use ""all"" to delete all of your homes."
    5.     else:
    6.       if arg-1 is "all":
    7.         delete {homes::%player's uuid%::*}
    8.         send "<green>[13O] Deleted <red>ALL YOUR HOMES<green>!"
    9.         stop
    10.       else:
    11.         loop {homes::%player's UUID%::*}:
    12.           add loop-index to {_homes::*}  
    13.         if {_homes::*} contains arg-1:
    14.           send "<red>[13O] Deleting home %arg-1%<red>!"
    15.           delete {homes::%player's uuid%::%arg-1%}
    16.         else:
    17.           send "<red>[13O] Home %arg-1%<red> does not exist! Please check for proper spelling! If you try to delete all homes type 'all'!"
    18.  
    19. command /sethome13O [<text>]:
    20.   trigger:
    21.     if arg-1 is set:
    22.       loop {homes::%player's UUID%::*}:
    23.         add loop-index to {_homes::*}
    24.       if {_homes::*} does not contain arg-1:
    25.         set {homes::%player's uuid%::%arg-1%} to location of player
    26.         send "<green>[13O] Home %arg-1%<green> made at %player's location%<red>!" to player
    27.       else:
    28.         send "<red>[13O] Home %arg-1%<red> already exists, pick another name or delete it"
    29.     else:
    30.       send "&c[13O] You have to provide a proper name for your home e.g.: /sethome13O myhome"
    31.  
    32. command /homelist13O [<text>]:
    33.   trigger:
    34.     set {_homes::*} to {homes::%player's uuid%::*}
    35.     if {_homes::*} is not set:
    36.       send "<red> [13O] You don't have any homes set"
    37.     else:
    38.       loop {homes::%player's uuid%::*}:
    39.         add loop-index to {_x::*}
    40.       send "<green>[13O] Your homes: %{_x::*}%"
    Correct me if there are any problems with the code.
    --- Double Post Merged, Jun 18, 2021, Original Post Date: Jun 13, 2021 ---
    For some reason the homes got reset for me
    any idea why?
     
  7. Minecoll_YT

    Supporter Forums Helper

    Joined:
    Dec 2, 2018
    Messages:
    650
    Likes Received:
    39
    Every home or just for some players? And is it just this variable?
     
    • Like Like x 1
  8. Jayden13O

    Jayden13O Member

    Joined:
    Jun 9, 2021
    Messages:
    22
    Likes Received:
    1
    Don't know because i was the only person with the home, seems to be working fine.
    Thought there might have been a bug causing it, but it seems to be fine now.
    And it could have been me being stupid too actually.
    But thanks for helping me!
     
Thread Status:
Not open for further replies.

Share This Page

Loading...