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!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved remove and add to players inventory

Discussion in 'Requests' started by Cameron R Croser, May 13, 2020.

  1. Cameron R Croser

    Joined:
    May 13, 2020
    Messages:
    14
    Likes Received:
    0
    I need a script that would make it so when the player spawns into the server their inventory is empty but when they do /warp netherpvp they get added a chest named: '&aKit Selector &7(Right Click)' into their first slot of their hotbar??

    please help asap

     
  2. Best Answer:
    Post #10 by couger44, May 15, 2020
  3. couger44

    Supporter

    Joined:
    Feb 19, 2017
    Messages:
    714
    Likes Received:
    31
    Something like this?
    Code (Skript):
    1. on join:
    2.     wait a tick
    3.     clear player's inventory
    4.  
    5. on command "/warp netherpvp":
    6.     set slot 1 of player's current inventory to chest named "&aKit Selector &7(Right Click)"
     
  4. Cameron R Croser

    Joined:
    May 13, 2020
    Messages:
    14
    Likes Received:
    0
    yes thats it, but i want it so when they go back to /spawn it clears their inventory again
     
  5. couger44

    Supporter

    Joined:
    Feb 19, 2017
    Messages:
    714
    Likes Received:
    31
    Then add to the code:
    Code (Skript):
    1. on command "/spawn":
    2.     clear player's inventory
    Be careful with the CombatLog plugins you have. If the player is in combat and uses the /spawn, all items will be deleted. If you have your server's spawn in a separate world, do this:
    Code (Skript):
    1. on player world change:
    2.     if world is "spawn":
    3.         clear player's inventory
     
  6. Cameron R Croser

    Joined:
    May 13, 2020
    Messages:
    14
    Likes Received:
    0
    It works perfectly. But i have one more issue, I did /setworldspawn and /setspawn and it works for new players but when I join it teleports me to my previous spawn??
     
  7. couger44

    Supporter

    Joined:
    Feb 19, 2017
    Messages:
    714
    Likes Received:
    31
    I recommend you create your own 'setspawn' skript. Avoid problems like the one you just told me.
    Code (Skript):
    1. command /setspawn:
    2.     permission: setspawn.use
    3.     trigger:
    4.         set {spawn} to player's location
    5.         send "&aThe spawn has been set!"
    6.  
    7. command /spawn:
    8.     trigger:
    9.         teleport player to {spawn}
    10.  
    11. on join:
    12.     teleport player to {spawn}
    13. on first join:
    14.     teleport player to {spawn}
     
  8. Cameron R Croser

    Joined:
    May 13, 2020
    Messages:
    14
    Likes Received:
    0
    Where is the best tutorials to learn to skript?
     
  9. couger44

    Supporter

    Joined:
    Feb 19, 2017
    Messages:
    714
    Likes Received:
    31
    Uff, i wouldn't know how to answer you. In my case, I learned skript through of a person's skripts. And then I was deepening the learning in this forum.
     
  10. Cameron R Croser

    Joined:
    May 13, 2020
    Messages:
    14
    Likes Received:
    0
    I got a warp sign and the chest doesn't give it to the player bec they don't use /warp netherpvp anymore.. How would I make it so they receive the chest on right click of that certain sign?

    Sign:
    [Warp]
    netherpvp
    everyone
     
  11. couger44

    Supporter

    Joined:
    Feb 19, 2017
    Messages:
    714
    Likes Received:
    31
    Be sure to create another post when you have a question apart from the original post. For your answer this would work:
    Code (Skript):
    1.  
    2. on right click on sign:
    3.     line 1 is "[Warp]":
    4.         line 2 is "netherpvp":
    5.             line 3 is "everyone":
    6.                 player command "warp netherpvp"
    Mark the post as solved if you had what you wanted from the start.
     

Share This Page

Loading...