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.


Discussion in 'Scripts' started by Revelationage, Oct 16, 2018.

  1. Revelationage

    Revelationage Well-Known Member

    Jan 27, 2017
    Likes Received:
    View attachment 2829


    SafeTrade is a script that makes trading items between players easy and simple.

    - Safe and simple way for people to trade items
    - Configurable messages
    - Inventory checker for full inventory
    - Creative mode option
    - Configurable trade cool down and trade time out
    - Configurable distance and same world checker
    - Configurable countdown timer when trading for safety
    - Configurable sounds for specific functions
    - Configurable GUI items

    - /trade [<player>] - Request a trade / Accept a trade
    - /tradetoggle - Enable or disable trading
    - /treload - Reload the config of the script

    - trade.use (for /trade and /tradetoggle)
    - trade.reload (for /treload)

    Required Plugins
    Skript Bensku fork dev37c: https://github.com/SkriptLang/Skript/releases/tag/dev37c
    SkQuery fork: https://www.spigotmc.org/resources/unofficial-skquery-fork-1-6-1-12.36631/
    Skellett: https://www.spigotmc.org/resources/skript-java-addon-skellett.34361/
    Skript-Yaml: https://www.spigotmc.org/resources/skript-yaml.49829/

    1. Drop all the plugins above into plugins folder and restart server.
    2. Download this resource (trade.sk) and put it in the plugins/Skript/scripts folder
    3. You can either restart the server again or do /sk reload trade
    4. Your done!

    Known Bugs
    1. Sometimes shift click does not work (only like 3% of the time) The next click should work fine though. This is not a game breaking bug so you should not worry about it (it is just sometimes a little annoying).

    Extra Information
    1. To put items up for trade, you have to shift click the items. There is a reason for this and I will not change it.
    2. Feel free to edit the script's source code to your liking but do not claim it as your own.
    3. I will most likely not add economy support to this. If you want to have eco with this trade, then either make a physical currency or use a plugin that allows you to convert virtual currency to physical currency.
    4. Here is my discord if you have any questions or need help: AsuDev#0714

    View attachment 2828

    Code (Skript):
    3. Messages:
    4.     Prefix: '&8&l[&e&lTRADING&8&l]'
    5.     TradeNoPermission: '{prefix} &cYou do not have permission to trade.'
    6.     TradeToggleDisabled: '{prefix} &cYou disabled trading...'
    7.     TradeToggleEnabled: '{prefix} &aYou enabled trading...'
    8.     TradeSelf: '{prefix} &cYeah, because I would definitely allow you to trade yourself.'
    9.     TradeCooldown: '{prefix} &cPlease wait a few seconds before using this command
    10.         again.'
    11.     PlayerHasTradingDisabled: '{prefix} &cThe player you specified has trading disabled...'
    12.     NoTradeInCreative: '{prefix} &cYou cannot trade in creative mode.'
    13.     NoTradeInCreative2: '{prefix} &cThe other player is in creative mode.'
    14.     NotSameWorld: '{prefix} &cYou must be in the same world as the specified player
    15.         to trade them.'
    16.     OutOfDistance: '{prefix} &cYou are too far away from the specified player to trade
    17.         them.'
    18.     RequestAlreadySent: '{prefix} &cYou already sent this player a trade request...'
    19.     ClickCorrection: '{prefix} &6Shift click items in your inventory to put up trade
    20.         offers.'
    21.     GuiName: '&a?You?              &c?Other?'
    22.     RequestSent: '{prefix} &7You sent a trade request to &6{target}&7...'
    23.     TradeCanceled: '&8&l[&4?&8&l] &cThe other player canceled the trade. &8&l[&4?&8&l]'
    24.     TradeCanceled2: '&8&l[&4?&8&l] &cYou canceled the trade. &8&l[&4?&8&l]'
    25.     TradeAccepted: '&8&l[&a?&8&l] &bTrade complete. &7Please report any scams! &8&l[&a?&8&l]'
    26.     TradeReloaded: '{prefix} &aThe trade config has been reloaded.'
    27.     RequestReceived: <command:/trade {player}><tooltip:{prefix}|nl|&7Click to accept
    28.         the trade.>{prefix} &6{player} &7sent you a trade request.
    30. # Does /trade have a cooldown? Put true or false
    31. # Cooldown duration in seconds
    32. TradeCooldown:
    33.     Enabled: true
    34.     Timer: 5
    36. # The timout duration of a trade offer
    37. # The countdown of trade ending
    38. # Cooldown duration in seconds
    39. # Do players have to be in same world to trade
    40. # Distance limit for trading (Set to Infinite for no limit)
    41. # Should players be able to trade in creative? true/false
    42. Trade:
    43.     TimeOut: 20
    44.     CountDown: 6
    45.     SameWorld: true
    46.     Distance: Infinite
    47.     TradeInCreative: true
    49. # Sound played when adding an item to a trade
    50. # Is this sound enabled? Put true/false
    51. # The name of the sound played
    52. # How loud the played sound is
    53. # The pitch of the sound played
    54. # Sounds found at: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Sound.html
    55. AddOffer:
    56.     PlaySound: true
    58.     Volume: 1
    59.     Pitch: 1
    61. # Sound played when the trade is successful
    62. # Is this sound enabled? Put true/false
    63. # The name of the sound played
    64. # How loud the played sound is
    65. # The pitch of the sound played
    66. # Sounds found at: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Sound.html
    67. TradeComplete:
    68.     PlaySound: true
    69.     SoundName: ENTITY_PLAYER_LEVELUP
    70.     Volume: 1
    71.     Pitch: 1
    73. # Sound played when the trade is successful
    74. # Is this sound enabled? Put true/false
    75. # The name of the sound played
    76. # How loud the played sound is
    77. # The pitch of the sound played
    78. # Sounds found at: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Sound.html
    79. TradeCanceled:
    80.     PlaySound: true
    81.     SoundName: BLOCK_ANVIL_LAND
    82.     Volume: 1
    83.     Pitch: 0.1
    85. # The gui item for Not Ready (DO NOT SET TO AIR)
    86. NotReady:
    87.     ItemID: '351:8'
    88.     Name: '&7Not Ready...'
    89.     Lore:
    90.     - Empty
    92. # The gui item for Ready (DO NOT SET TO AIR)
    93. Ready:
    94.     ItemID: '351:10'
    95.     Name: '&a&lREADY'
    96.     Lore:
    97.     - Empty
    99. # The gui item for Accept Trade button (DO NOT SET TO AIR)
    100. Accept:
    101.     ItemID: '160:13'
    102.     Name: '&a&lACCEPT TRADE'
    103.     Lore:
    104.     - '&7&oClick to accept trade.'
    106. # The gui item for Cancel Trade button (DO NOT SET TO AIR)
    107. Cancel:
    108.     ItemID: '160:14'
    109.     Name: '&4&lCANCEL TRADE'
    110.     Lore:
    111.     - '&7&oClick to cancel trade.'
    113. # The gui item for Divider line (DO NOT SET TO AIR)
    114. Divider:
    115.     ItemID: 101
    116.     Name: '&4'
    117.     Lore:
    118.     - Empty
    120. # The gui item for Stop Timer item (DO NOT SET TO AIR)
    121. StopTimer:
    122.     ItemID: 166
    123.     Name: '&c&lSTOP TIMER'
    124.     Lore:
    125.     - '&7&oClick to stop the timer.'
    127. # The gui item for Blank Slot item (DO NOT SET TO AIR)
    128. BlankSlot:
    129.     ItemID: '160:8'
    130.     Name: '&4'
    131.     Lore:
    132.     - Empty