Advertisement
Guest User

m-MysteryBox

a guest
May 15th, 2022
900
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.92 KB | None | 0 0
  1. Config = {}
  2.  
  3. --------------------------
  4. -- Utility
  5. --------------------------
  6. Config.Utility = {
  7. Framework = "QBCore", -- QBCore or ESX
  8. CoreName = "qb-core", -- Core Name or Trigger ESX: esx:getSharedObject
  9. ItemBox = "inventory:client:ItemBox", -- If you are usign ESX don't touch this
  10. EnableBurn = true, -- Enable burn player?
  11. ChanceBurn = 10, -- Chance to burn player
  12. EnableCustomSounds = true,
  13. TriggerSound = "InteractSound_SV:PlayOnSource", -- Trigger of custom sound
  14. Volume = 0.2, -- Volume of custom sound
  15. Cooldown = true, -- Cooldown?
  16. CooldownTime = 60000, -- 1 Minute
  17. Rewards = { -- Only works item's
  18. Small_MysteryBox = {
  19. Amount = 1, -- Amount of item
  20. Chance = 10, -- 10% Chance to get rare ITEM
  21. Normal_Items = {
  22. [1] = "phone",
  23. [2] = "iron",
  24. [3] = "water_bottle",
  25. [4] = "lockpick",
  26. [5] = "electronickit",
  27. },
  28. Rare_Items = {
  29. [1] = "phone",
  30. [2] = "iron",
  31. [3] = "water_bottle",
  32. [4] = "lockpick",
  33. [5] = "electronickit",
  34. }
  35. },
  36. Medium_MysteryBox = {
  37. Amount = 2, -- Amount of item
  38. Chance = 10, -- 10% Chance to get rare ITEM
  39. Normal_Items = {
  40. [1] = "phone",
  41. [2] = "iron",
  42. [3] = "water_bottle",
  43. [4] = "lockpick",
  44. [5] = "electronickit",
  45. },
  46. Rare_Items = {
  47. [1] = "phone",
  48. [2] = "iron",
  49. [3] = "water_bottle",
  50. [4] = "lockpick",
  51. [5] = "electronickit",
  52. }
  53. },
  54. Large_MysteryBox = {
  55. Amount = 3, -- Amount of item
  56. Chance = 10, -- 10% Chance to get rare ITEM
  57. Normal_Items = {
  58. [1] = "phone",
  59. [2] = "iron",
  60. [3] = "water_bottle",
  61. [4] = "lockpick",
  62. [5] = "electronickit",
  63. },
  64. Rare_Items = {
  65. [1] = "phone",
  66. [2] = "iron",
  67. [3] = "water_bottle",
  68. [4] = "lockpick",
  69. [5] = "electronickit",
  70. }
  71. },
  72. }
  73. }
  74.  
  75. Language = {
  76. NoJob = "You don't have the necessary work.",
  77. NoGang = "You don't have the necessary gang.",
  78. OpenMystery = "Opening the mystery box...",
  79. Dead = "You cannot access the mystery box while dead.",
  80. Water = "You cannot access the mystery box in the water.",
  81. Wait = "You need to wait to open another mystery box.",
  82. }
  83.  
  84. function Notify(msg)
  85. if Config.Utility.Framework == "QBCore" then
  86. QBCore.Functions.Notify(msg)
  87. elseif Config.Utility.Framework == "ESX" then
  88. exports['mythic_notify']:SendAlert('error', msg, 5000)
  89. end
  90. end
  91.  
  92. function progressBar()
  93. if Config.Utility.Framework == "QBCore" then
  94. QBCore.Functions.Progressbar("AbrirMysteryBox", Language.OpenMystery, 2500, false, true, {disableMovement = true,disableCarMovement = true,disableMouse = false,
  95. disableCombat = true}, {animDict = "mp_arresting",anim = "a_uncuff",flags = 49}, {}, {}, function() end)
  96. elseif Config.Utility.Framework == "ESX" then
  97. TriggerEvent("mythic_progbar:client:progress", {
  98. name = "AbrirMysteryBox",
  99. duration = 2500,
  100. label = Language.OpenMystery,
  101. useWhileDead = false,
  102. canCancel = true,
  103. controlDisables = {
  104. disableMovement = true,
  105. disableCarMovement = true,
  106. disableMouse = false,
  107. disableCombat = true,
  108. },
  109. animation = {
  110. animDict = "mp_arresting",
  111. anim = "a_uncuff",
  112. },
  113. }, function(status)
  114. end)
  115. end
  116. end
  117.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement