Filled Warp With Items

Discussion in 'Archived: Plugin Requests' started by GPellizzon, Jul 3, 2013.

  1. Offline

    GPellizzon

    Plugin category: Teleportation

    Suggested name: WarpWithItems

    What I want: When someone type in /warp <warp-name> they receive items. But, I would like to config the items that they would receive on a specific warp in-game by using a command.

    Ideas for commands:
    /setwarp <warp-name>
    /delwarp <warp-name>
    /warp <warp-name>
    /itemwarpset <warp-name> <item id> <item quantity> (OBS.: IF I WANT TO SET MORE THAN 1 ITEM, I WOULD LIKE TO SEPARATE THE ITEM IDS AND THE ITEM QUANTITIES WITH A COMMA. SO, TO SEPARATE THE ITEM QUANTITY OF THE ITEM ID I WOULD USE THE SPACE KEY. Ex.: /itemwarpset warp1 1,2,3 10,10,10 (I would warp to warp1 and I would receive 10 stone blocks, 10 grass blocks and 10 dirt blocks).

    Ideas for permissions:
    warpwithitems.opsetwarp (If I set this to false, OPs will not be able to use the /setwarp command)
    warpwithitems.opdelwarp (If I set this to false, OPs will not be able to use the /delwarp command)
    warpwithitems.opitemset (If I set this to false, OPs will not be able to use the /itemwarpset command)
    warpwithitems.playerwarp (If I set this to false, Players will not be able to use the /warp command)

    SORRY FOR MY BAD ENGLISH, I'M BRAZILIAN!

    EDIT: When a player warps, I think it would be cool to his inventory be cleaned so he would receive the items he need. And I want this plugin for both 1.5.2 and 1.6.1. Or just for 1.5.2.

    That's it!

    Also, I would like to be able to warp by right-clicking a sign. For instance, a player would warp to a place by right-clicking a sign that would be written like this:
    (1st line) [Warp]
    (2nd line) <warp-name>
    (3rd line) This is a description.
    (4th line) This is a description.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 2, 2016
  2. Offline

    Chaositic

    Use Essentials
    or Command Signs
    As for the first request, you should look into a plugin called Skript because it lets you make your own commands, permissions and I'm quite sure it has the power to assign commands to items. An alternative plugin would be OtherDrops but skript is powerful enough to give the player items on arrival with some coding like you've asked.
     
  3. Offline

    GPellizzon

    Thanks for replying. Is Skript easy to use? 'Cause I'm very bad at coding.
    I'm still going to wait for more people to reply. Anyway, thank you.
     
  4. Offline

    Chaositic

    Yeah its quite fun to learn I've found and it comes with several example files to fiddle around with. In addition, you can read the forums for tutorials including a youtube video that can teach you the basics.


    For giving players items after warping this skript might do the trick:

    Code:
    #Teleports to a warp
    command /swarp <text>:
        description: Teleports you to a warp
        permission: skript.warp
        executable by: players
        usage: /swarp <warp name>
        trigger:
            if variable {warp.%argument%} is set:
                set variable {tp.%player%.back} to location of player
                give 5 stone to the player
                teleport player to {warp.%argument%}
                message "<Purple>[LTP]<white> Teleported to %argument%."
                stop
            else:
                message "<Purple>[LTP]<white> %argument% is not set."
                stop
    #sets a warp
    command /ssetwarp <text>:
        description: Creates a new warp
        permission: skript.warp.set
        executable by: players
        usage: /ssetwarp <warp name>
        trigger:
            if variable {warp.%argument%} is set:
                message "<Purple>[LTP]<white> %argument% is already set!"
                stop
            else:
                set variable {warp.%argument%} to location of player
                message "<Purple>[LTP]<White> Warp %argument% set."
                stop
    #Deletes a warp
    command /sdelwarp <text>:
        description: Deletes a warp
        permission: skript.warp.set
        usage: /sdelwarp <warp name>
        trigger:
            if variable {warp.%argument%} is not set:
                message "<Purple>[LTP]<white> %argument% is not set!"
                stop
            else:
                delete {warp.%argument%}
                message "<Purple>[LTP]<white> Warp %argument% deleted."
                stop
    Credit for this code goes to Cam13619 on the Skript Replacers forum. You can find that link here
    Lotus-Warp

    What I've done is changed some of the commands so that they don't conflict with plugins like Essentials and I've made it so that when a player warps, they will be given 5 stone. Now I'm not actually that advanced with Skript and I did have to look up the Effect of giving an item to a player to make this modification. That means you probably will have to do some reading up on this so that when specific warp names are detected in the command, it will give certain items. For now, just change 'stone' to a valid item name like 'grass' or 'dirt'.

    You can also easily change the command name, command syntax, and the permission needed to do the commands. I strongly advise you read the tutorials listed on the first page of the Skript bukkitdev page.

    Sorry this took so long. I had to make sure this skript worked by testing on my own server first before posting. I hope this helps you out.
     
  5. Offline

    GPellizzon

    Thank you so much, Chaositic!
     
  6. Offline

    GPellizzon

    @Chaositic Well, if I want the player to receive more than 1 item, what should I write?
     
  7. Offline

    Chaositic

    Copy the line "give 5 stone to the player", press enter so its on a new lines, paste your copy and then press tab until its lined up with the one above. Then change stone to the item you want to give the player and the 5 to the amount you want.

    If after trying that you get some errors, I can help you out with the code, just give me the items you want to give them.
     
  8. Offline

    GPellizzon

    Uhm ok. I'll try it later. Thanks!

    @Chaositic Where should I paste this code? In the variables.csv file?

    Well, I'll still wait for more people to reply. I'm anxious to see if someone can create this plug-in. Otherwise, I'll use Skript for that (thank to Chaositic!)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 2, 2016
  9. Offline

    Chaositic

    No you would edit the script file you made in the original file and add it to that.
     
  10. Offline

    GPellizzon

    But, I didn't make any Script file XD
     

Share This Page