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 our 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.

Clear it from

Discussion in 'Skript' started by KAVKAZIE, Jun 12, 2019 at 2:28 AM.

  1. KAVKAZIE

    KAVKAZIE Well-Known Member

    Joined:
    Feb 27, 2017
    Messages:
    109
    Likes Received:
    0
    Hey, How to clear this:
    Code (Text):
    1.             set {Inv::%executor%} to executor's serialized inventory
    2.             set {stuff.%player%} to player's serialized inventory
    3.             set {helm.%player%} to player's helmet
    4.             set {chest.%player%} to player's chestplate
    5.             set {legs.%player%} to player's leggings
    6.             set {boots.%player%} to player's boots
    after the player left staff mode and clear it from variables.csv

    Code (Text):
    1. command /staffmode:
    2.     aliases: staff, sm
    3.     permission: staff.rank
    4.     permission message: &cUnknown command or you don't have permission.
    5.     trigger:
    6.         if {mod.%player%} is not set:
    7.             set the player's gamemode to creative
    8.             send "&6Staff Mode&7: &aEnabled"
    9.             reveal all players to player
    10.             set {Inv::%executor%} to executor's serialized inventory
    11.             set {stuff.%player%} to player's serialized inventory
    12.             set {helm.%player%} to player's helmet
    13.             set {chest.%player%} to player's chestplate
    14.             set {legs.%player%} to player's leggings
    15.             set {boots.%player%} to player's boots
    16.             clear player's inventory
    17.             set slot 0 of player to compass named "&6Teleporter Tool"
    18.             set slot 1 of player to book named "&6Inventory Inspect &7(Click on Player)"
    19.             set slot 2 of player to ice named "&6Freeze &7(Click on Player)"
    20.             set slot 7 of player to player head named "&6Online Staff &7(Right Click)"
    21.             set slot 8 of player to light green dye named "&6Vanish &a(Enabled)"
    22.             set player's leggings to chain leggings
    23.             make player execute command "/§vanish-on"
    24.             loop all players:
    25.                 if {mod.%loop-player%} is set:
    26.                     reveal player to loop-player
    27.             set {mod.%player%} to true
    28.             stop
    29.         else:
    30.             set the player's gamemode to survival
    31.             send "&6Staff Mode&7: &cDisabled"
    32.             make player execute command "/§vanish-off"
    33.             loop all players:
    34.                 if {vanish.%loop-player%} is set:
    35.                     hide loop-player from player
    36.             clear player's leggings
    37.             clear player's inventory
    38.             restore inventory of executor from {Inv::%executor%}
    39.             set player's helmet to {helm.%player%}
    40.             set player's chestplate to {chest.%player%}
    41.             set player's leggings to {legs.%player%}
    42.             set player's boots to {boots.%player%}
    43.             delete {mod.%player%}
    44.             stop
     
  2. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    1,811
    Likes Received:
    125
    Code (Text):
    1. delete {var}
     
  3. KAVKAZIE

    KAVKAZIE Well-Known Member

    Joined:
    Feb 27, 2017
    Messages:
    109
    Likes Received:
    0
    its doesnt removing it (And its making the variables.csv file more bigger)
     
  4. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    1,811
    Likes Received:
    125
    show your new code, lets see if we can figure this out
     
  5. KAVKAZIE

    KAVKAZIE Well-Known Member

    Joined:
    Feb 27, 2017
    Messages:
    109
    Likes Received:
    0
    The code is here
     
  6. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    1,811
    Likes Received:
    125
    Theres nothing in your code about deleting those variables, since you aren't using list variables, you have to delete each variable, one by one
    --- Double Post Merged, Jun 12, 2019 at 7:35 PM, Original Post Date: Jun 12, 2019 at 7:33 PM ---
    If you were to have used list variables for saving things, like so: (this is an example of usage)
    Code (Skript):
    1. command /save:
    2.     trigger:
    3.         set {inventories::%uuid of player%%::helmet} to helmet of player
    4.         set {inventories::%uuid of player%%::chestplate} to chestplate of player
    5.         set {inventories::%uuid of player%%::leggings} to leggings of player
    6.         set {inventories::%uuid of player%%::boots} to boots of player
    Then when you restore the player's inventory, you can easily/quickly delete the entire list:
    Code (Skript):
    1. command /load:
    2.     trigger:
    3.         #code to load back onto your player
    4.         delete {inventories::%uuid of player%::*} #<-- deletes the whole list
     
Loading...