Advertisement
Cat_in_the_hat

Mystery box had a rare and common list that dose different texture id effect ! In roblox bedwars

Dec 6th, 2023
162
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.56 KB | None | 0 0
  1. local costSpine = 1 -- Customize the cost here
  2. local itemNeeded = "block_hunt_coin" -- Customize the required item here
  3.  
  4. local commonList = {
  5. {"stopwatch", 1},
  6. {"duck_spawn_egg", 5},
  7. {"treasure_chest", 5},
  8. {"stopwatch", 5},
  9. {"emerald_dao", 1},
  10. {"grappling_hook", 1},
  11. {"pie", 5},
  12. {"balloon", 50},
  13. {"swap_ball", 5},
  14. {"speed_boots", 1},
  15. {"stopwatch", 5},
  16. {"headhunter", 1},
  17. {"firework_arrow", 350}
  18. }
  19.  
  20. local commonParticleId = "rbxassetid://12605639346"
  21.  
  22. local rareList = {
  23. {"double_rainbow_boots", 1},
  24. {"mythic_great_hammer", 1},
  25. {"heal_banner", 25},
  26. {"spider_web", 10},
  27. {"telepearl", 2},
  28. {"crit_star", 35},
  29. {"spirit_bridge", 10},
  30. {"teleport_hat", 1},
  31. {"rainbow_backpack", 1},
  32. {"flying_backpack", 1},
  33. {"bacon_blade", 1},
  34. {"chicken_deploy", 10},
  35. {"block_hunt_coin", 5},
  36. {"beehive_grenade", 10}
  37. }
  38.  
  39. local rareParticleId = "rbxassetid://10653373712"
  40.  
  41. local function giveSpecificItem(player, itemName, quantity)
  42. InventoryService.giveItem(player, itemName, quantity, true)
  43. end
  44.  
  45. local function rotateAndDestroyFinalItem(finalItemTypeModel, player, finalItem, finalAmount, copperPosition, createPrompt)
  46. local finalItemPosition = finalItemTypeModel:getPosition()
  47.  
  48. local cloudSpawnPosition = finalItemPosition - Vector3.new(0, 3, 0)
  49. local cloudColor = Color3.new(0.8, 0.8, 0.8)
  50. local cloudParticles = ParticleService.createParticleEmitter(cloudSpawnPosition, Vector3.new(2, 23.5, 0))
  51.  
  52. -- Set particle texture based on item list
  53. local particleId = commonParticleId
  54. for _, item in pairs(commonList) do
  55. if item[1] == finalItem then
  56. particleId = commonParticleId
  57. break
  58. end
  59. end
  60.  
  61. for _, item in pairs(rareList) do
  62. if item[1] == finalItem then
  63. particleId = rareParticleId
  64. break
  65. end
  66. end
  67.  
  68. cloudParticles:setTexture(particleId)
  69.  
  70. cloudParticles:setRotation(Vector3.new(1, 0, 0))
  71. cloudParticles:setRate(50)
  72. cloudParticles:setLifetime(NumberRange.new(30, 40))
  73. cloudParticles:setSpeed(NumberRange.new(5, 9))
  74. cloudParticles:setDrag(0.2)
  75. cloudParticles:setBrightness(20)
  76. cloudParticles:setParticleOrientation(ParticleOrientation.VelocityParallel)
  77. cloudParticles:setSpreadAngle(Vector2.new(-40, 40))
  78. cloudParticles:setRotSpeed(NumberRange.new(9, 11))
  79.  
  80. local cloudColorSequence = ColorSequence.new(cloudColor)
  81. cloudParticles:setColor(cloudColorSequence)
  82.  
  83. SoundService.playSound(SoundType.VENDING_ROLL_PRIZE, cloudSpawnPosition)
  84.  
  85. createPrompt(copperPosition)
  86.  
  87. for i = 1, 100 do
  88. finalItemTypeModel:setRotation(Vector3.new(0, 40, 0))
  89. wait(0.001)
  90. end
  91.  
  92. cloudParticles:destroy()
  93.  
  94. finalItemTypeModel:destroy()
  95.  
  96. createPrompt(copperPosition)
  97.  
  98. MessageService.sendInfo(player, "You received: " .. finalAmount .. "x " .. string.upper(finalItem) .. "!")
  99. end
  100.  
  101. local function createPrompt(copperPosition)
  102. local promptCopper = PromptService.createPrompt()
  103. promptCopper:setHoldDuration(3.5)
  104. promptCopper:setActivationDistance(10)
  105. promptCopper:setPosition(copperPosition)
  106. promptCopper:setObjectText("buy a spin for 1 coin you can get the coin from asking the cohost/owner or you can get it from the shop !")
  107. promptCopper:setActionText("1 coin for 1 spin")
  108.  
  109. promptCopper:onActivated(function(player)
  110. if player then
  111. if InventoryService.getAmount(player, itemNeeded) >= costSpine then
  112. promptCopper:destroy() -- Destroy the prompt only if the player has the required amount
  113.  
  114. local startTime = tick()
  115.  
  116. -- Remove the required item from the player's inventory after prompt destruction
  117. local removedAmount = InventoryService.removeItemAmount(player, itemNeeded, costSpine)
  118.  
  119. while tick() - startTime < 10 do
  120. local randomList
  121. local particleId
  122.  
  123. if math.random() < 0.5 then
  124. randomList = commonList
  125. particleId = commonParticleId
  126. else
  127. randomList = rareList
  128. particleId = rareParticleId
  129. end
  130.  
  131. local randomReward = randomList[math.random(#randomList)]
  132. local randomItem = randomReward[1]
  133.  
  134. local itemTypeModel = ModelService.createItemModel(randomItem, copperPosition + Vector3.new(0, 6, 0))
  135. itemTypeModel:setScale(1.5)
  136. itemTypeModel:setAnchored(true)
  137. itemTypeModel:setCollidable(false)
  138.  
  139. giveSpecificItem(player, randomItem, 0)
  140. wait(0.2)
  141. itemTypeModel:destroy()
  142. SoundService.playSound(SoundType.STOPWATCH_ACTIVATED, copperPosition)
  143. end
  144.  
  145. wait(1)
  146.  
  147. local finalList
  148. local finalParticleId
  149.  
  150. if math.random() < 0.5 then
  151. finalList = commonList
  152. finalParticleId = commonParticleId
  153. else
  154. finalList = rareList
  155. finalParticleId = rareParticleId
  156. end
  157.  
  158. local finalReward = finalList[math.random(#finalList)]
  159. local finalItem = finalReward[1]
  160. local finalAmount = finalReward[2]
  161.  
  162. local finalItemTypeModel = ModelService.createItemModel(finalItem, copperPosition + Vector3.new(0, 9., 0))
  163. finalItemTypeModel:setScale(4.8)
  164. finalItemTypeModel:setAnchored(true)
  165. finalItemTypeModel:setCollidable(false)
  166.  
  167. giveSpecificItem(player, finalItem, finalAmount)
  168.  
  169. SoundService.playSound(SoundType.FIREWORK_EXPLODE_2, copperPosition)
  170.  
  171. rotateAndDestroyFinalItem(finalItemTypeModel, player, finalItem, finalAmount, copperPosition, createPrompt)
  172. else
  173. MessageService.sendInfo(player, "Insufficient " .. string.upper(itemNeeded) .. ". You need at least " .. costSpine .. " " .. string.upper(itemNeeded) .. " to proceed.")
  174. end
  175. end
  176. end)
  177. end
  178.  
  179. Events.BlockPlace(function(event)
  180. if (event.blockType == ItemType.COPPER_BLOCK) then
  181. local copperPosition = event.position
  182. createPrompt(copperPosition)
  183. end
  184. end)
  185.  
Advertisement
Comments
  • Cat_in_the_hat
    353 days
    # text 0.13 KB | 0 0
    1. This script has it own common and rare lost meaning what every time it lands on it dose a different image id that you can set it to
    2.  
Add Comment
Please, Sign In to add comment
Advertisement