Advertisement
SMmest3r

Mest3r Treasure chest system 3.0

Dec 6th, 2022
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.54 KB | Source Code | 0 0
  1. Config = {}
  2.  
  3. --Coordinates
  4. Config.treasures = {
  5.     --DO NOT CHANGE !Opened! VALUE unless you know what you're doing!
  6.     {x = 499.63, y = 5607.63, z = 795.67, Opened = false, Treasure}, --1
  7.     {x = 455.46, y = -839.52, z = 26.65, Opened = false, Treasure}, --2
  8.     {x = -336.02, y = -958.33, z = 30.61, Opened = false, Treasure}, --3
  9.     {x = 694.34, y = 551.54, z = 128.05, Opened = false, Treasure}, --4
  10.     {x = -1577.89, y = -970.92, z = 16.41, Opened = false, Treasure}, --5
  11.     {x = -1888.38, y = -582.74, z = 10.83, Opened = false, Treasure}, --6
  12.     {x = -2293.29, y = 209.6, z = 166.6, Opened = false, Treasure}, --7
  13.     {x = -1350.04, y = 21.74, z = 52.45, Opened = false, Treasure}, --8
  14.     {x = 3604.26, y = 3736.03, z = 27.69, Opened = false, Treasure}, --9
  15.     {x = 2136.27, y = 4831.88, z = 40.64, Opened = false, Treasure}, --10
  16.     {x = 1710.66, y = 3611.14, z = 34.09, Opened = false, Treasure}, --11
  17.     {x = 781.72, y = -3187.66, z = 5.09, Opened = false, Treasure}, --12
  18.     {x = 153.92, y = -3108.18, z = 4.9, Opened = false, Treasure}, --13
  19.     {x = -347.7, y = -1862.19, z = 27.66, Opened = false, Treasure}, --14
  20.     {x = 185.13,  y = -730.53, z = 46.08, Opened = false, Treasure}, --15
  21.     {x = 2654.32, y = 1425.1, z = 23.52, Opened = false, Treasure}, --16
  22.     {x = 2563.98, y = 2587.49, z = 37.08, Opened = false, Treasure}, --17
  23.     {x = 2949.65, y = 2741.14, z = 43.03, Opened = false, Treasure}, --18
  24.     {x = 1910.55, y = 3283.843, z = 43.56, Opened = false, Treasure}, --19
  25.     {x = 67.15, y = 3655.69, z = 38.67, Opened = false, Treasure}, --20
  26.     {x = -2297.51, y = 3191.1, z = 31.81, Opened = false, Treasure}, --21
  27.     {x = 170.62, y = -908.9, z = 29.69, Opened = false, Treasure}, --22
  28.     {x = 677.86, y = 686.74, z = 129.46, Opened = false, Treasure}, --23
  29.     {x = 5.48, y = -1386.95, z = 29.29, Opened = false, Treasure}, --24
  30.     {x = 857.48, y = -948.71, z = 25.28, Opened = false, Treasure}, --25
  31.     {x = 1665.19, y = 0.73, z = 165.12, Opened = false, Treasure}, --26
  32.     {x = -90.29, y = -1010.4, z = 26.31, Opened = false, Treasure}, --27
  33.     {x = 2520.47, y = 2621.87, z = 36.94, Opened = false, Treasure}, --28
  34.     {x = 1201.26, y = 2656.5, z = 36.85, Opened = false, Treasure}, --29
  35.     {x = -2349.48, y = 2815.32, z = 0.71, Opened = false, Treasure}, --30
  36.     {x = 37.21, y = 6555.49, z = 30.45, Opened = false, Treasure}, --31
  37.     {x = -927.89, y = 6148.93, z = 4.56, Opened = false, Treasure}, --32
  38.     {x = -1280.2, y = 2553.37, z = 17.39, Opened = false, Treasure}, --33
  39.     {x = -2472.78, y = 2305.78, z = 31.01, Opened = false, Treasure}, --34
  40.     {x = -1663.54, y = -292.07, z = 50.88, Opened = false, Treasure}, --35
  41.     {x = 1077.88, y = -750.55, z = 56.97, Opened = false, Treasure}, --36
  42.     {x = -1428.16, y = -420.71, z = 35.36, Opened = false, Treasure}, --37
  43.     {x = -2115.73, y = -316.28, z = 12.59, Opened = false, Treasure}, --38
  44.     {x = -769.33, y = -931.08, z = 17.07, Opened = false, Treasure}, --39
  45.     {x = -221.0, y = -1498.05, z = 30.61, Opened = false, Treasure}, --40
  46.     {x = 244.14, y = -1273.74, z = 28.44, Opened = false, Treasure}, --41
  47.     {x = 1789.34, y = -1541.54, z = 112.26, Opened = false, Treasure}, --42
  48.     {x = 1282.99, y = -725.94, z = 63.49, Opened = false, Treasure}, --43
  49. }
  50.  
  51. --Any item you want to be winnible by players
  52. Config.winnibleitems = {
  53.     "diamond_ore",
  54.     "bread"
  55. }
  56.  
  57. --The object name
  58. Config.object = "xm_prop_x17_chest_closed"
  59. -- The spawn name of the vehicle that players can got from chests
  60. Config.winniblevehiclename = "cheburek"
  61. --Set it true if you want players to have chance to win a car
  62. Config.canwincar = true
  63. --The number of item when player got item from the chest
  64. Config.winitemamount = 25
  65. --Win chance for item. Now it's 1 to 15
  66. Config.winchance = 15 --Minimum 3
  67. --The item name what the player needs to have to open a chest
  68. Config.keyitem = "treasurekey"
  69. --If false then players can open the treasure chests without key item
  70. Config.needkey = false
  71. --How much time player need to wait to open a chest again (in minute)
  72. Config.wait = 2
  73. --How far would player see the text of the treasure chest (in coords)
  74. Config.distance = 3
  75. --How often should each treasure chest spawn again (in minutes) [You only need to edit this if you have Config.Deletetreasurechest on true]
  76. Config.TreasureRespawn = 30
  77. --Set it false if you don't want treasures to disappear when opened.
  78. Config.DeleteTreasurechest = true
  79. --What framework are you using? "oldESX" or "ESX" or "QBCore"
  80. Config.Framework = "ESX"
  81.  
  82. --Notification types
  83. Config.Red = "error"
  84. Config.Green = "success"
  85.  
  86. --Messages and text
  87. Config.text = "Treasure Chest [E]"
  88. Config.money = "Congratulations! You found a treasure chest and there was money in it!"
  89. Config.item = "Congratulations! You found a treasure chest and you found "
  90. Config.itemending = --[[Item  name will be here in the notify]] " in it!"
  91. Config.carkey = "Congratulations! You have found a car key in the chest!"
  92. Config.nokeytext = "You need a key to open the treausre chest!"
  93. Config.youneedtowait = "Someone just opened a chest. You need to wait "
  94. Config.Reappered = "All opened crates are put back in place"
  95. --How player got the money. True = cash; false = bank
  96. Config.cash = true
  97. --How much the player got from the treasure chest if he got more money.
  98. Config.winbig = math.random(8000, 10000)
  99. -- How much the player got if he got less money from the chest
  100. Config.win = math.random(5000, 8000)
  101.  
  102. --Discord messages
  103. Config.dcmessagemoney = " Opened an chest and he/she found money in it!"
  104. Config.dcmessageitem = " Opened an chest and he/she found items!"
  105. Config.dcmessagelessmoney = " Opened an chest and he/she found less money in it!"
  106. Config.dccarkey = " Opened an chest and he/she carkey in it!"
  107.  
  108. --DE (Übersetzung von ZappisWelt#2205)
  109.  
  110.                                 --Nachrichten und Text
  111. -- Config.text = "Schatztruhe [E]"
  112. -- Config.money = "Herzlichen Glückwünsch! Du hast eine Schatztruhe gefunden und darin war Geld!"
  113. -- Config.item = "Herzlichen Glückwünsch! Du hast eine Schatztruhe gefunden und "
  114. -- Config.itemending = --[[Der Name des Artikels wird hier in der Benachrichtigung erscheinen]] " war darin!"
  115. -- Config.carkey = "Herzlichen Glückwünsch! Du hast einen Autoschlüssel in der Schatztruhe gefunden!"
  116. -- Config.nokeytext = "Du brauchst einen Schlüssel, um die Schatztruhe zu öffnen!"
  117. -- Config.youneedtowait = "Jemand anderes hat gerade eine Schatztruhe geöffnet. Du musst warten... "
  118. --Config.Reappered = "Alle geöffneten Kisten werden wieder an ihren Platz gestellt"
  119.                             --Discord-Nachrichten
  120. -- Config.dcmessagemoney = " hat eine Schatztruhe geöffnet und Geld darin gefunden!"
  121. -- Config.dcmessageitem = " hat eine Schatztruhe gefunden und Items darin gefunden!"
  122. -- Config.dcmessagelessmoney = " hat eine Schatztruhe geöffnet und Allmosen darin gefunden!"
  123. -- Config.dccarkey = " hat eine Schatztruhe geöffnet und ist nun darin eingesperrt!"
  124.  
  125. --Notification trigger
  126. RegisterNetEvent("treasure_notify")
  127. AddEventHandler("treasure_notify", function(type, msg)
  128.     --You can set your notification here (Some notification systems can already be found here just delete the two minus signs from the beginning)
  129.     --exports['okokNotify']:Alert("Treasurechest", msg, 5000, type) --okok notify (PAID resource)
  130.     --TriggerEvent("mosh_UI:Open", type, msg, "right", true) --Mosh UI / Notify (PAID resource)
  131.     --exports['mythic_notify']:DoHudText(type, msg) --Mythic Notify (Free resource)
  132.     --exports["skeexsNotify"]:TriggerNotification({ ['type'] = type, ['message'] = msg , Treasure}) --skeexsNotify (Free resource)
  133.     --TriggerEvent('QBCore:Notify', msg, type) --Default QBCore notifcation (Free resource)
  134.     TriggerEvent('esx:showNotification', msg) --Default ESX notification (Free resource)
  135. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement