Advertisement
iiFlamez

Untitled

Nov 11th, 2017
367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.53 KB | None | 0 0
  1. -- params : ...
  2.  
  3. Player = game.Players.LocalPlayer
  4. enabled = true
  5. enabled1 = true
  6. Weapon = nil
  7. script.Parent.Parent.Parent:WaitForChild("RedCode")
  8. Redeem = script.Parent.Parent.Parent.RedCode.Value
  9. script.Parent.Parent.Parent.RedCode:remove()
  10. T = {}
  11. for u,c in pairs(script.Parent:GetChildren()) do
  12. if c.ClassName == "ImageLabel" then
  13. T[#T + 1] = c.Image
  14. end
  15. end
  16. for u,c in pairs(script.Parent.Parent:GetChildren()) do
  17. if c.ClassName == "ImageLabel" then
  18. T[#T + 1] = c.Image
  19. end
  20. end
  21. local ContentProvider = game:GetService("ContentProvider")
  22. local LoadAssets = function(AssetList)
  23. for _,AssetId in pairs(AssetList) do
  24. ContentProvider:Preload(AssetId)
  25. end
  26. end
  27.  
  28. LoadAssets(T)
  29. FrewCloud = function()
  30. local a = nil
  31. if math.random(1, 2) == 1 then
  32. local Cloud = script.Parent.Parent.Cloud:Clone()
  33. Cloud.Parent = script.Parent.Parent
  34. Cloud.Visible = true
  35. Cloud.Position = UDim2.new(4.35, 0, 1, 0)
  36. game.Debris:AddItem(Cloud, 1.5)
  37. if math.random(1, 2) == 1 then
  38. a = -6
  39. else
  40. a = 14
  41. end
  42. Cloud:TweenPosition(UDim2.new(a, 0, math.random(-400, 800) / 100, 0))
  43. Cloud:TweenSize(UDim2.new(5.2, 0, 4, 0))
  44. else
  45. do
  46. local Cloud = script.Parent.Parent.Cloud:Clone()
  47. Cloud.Parent = script.Parent.Parent
  48. Cloud.Visible = true
  49. Cloud.Position = UDim2.new(4.35, 0, 1, 0)
  50. game.Debris:AddItem(Cloud, 1.5)
  51. if math.random(1, 2) == 1 then
  52. a = -6
  53. else
  54. a = 9
  55. end
  56. Cloud:TweenPosition(UDim2.new(math.random(-300, 1000) / 100, 0, a, 0))
  57. Cloud:TweenSize(UDim2.new(5.2, 0, 4, 0))
  58. end
  59. end
  60. end
  61.  
  62. FinalButton = function(Weapon)
  63. script.Parent.Parent.Accept.MouseButton1Click:connect(function()
  64. if not enabled1 or enabled then
  65. return
  66. end
  67. enabled1 = false
  68. game.Workspace.RemoteEvents:FindFirstChild("ChangeVal"):FireServer(Player.TextureGui.TextureId.Weapon, Weapon)
  69. game.Workspace.RemoteEvents:FindFirstChild("GiveWeaponPrize"):FireServer(Weapon)
  70. game.Workspace.RemoteEvents:FindFirstChild("ChangeVal"):FireServer(Player.bin.Shop, false)
  71. game.Workspace.RemoteEvents:FindFirstChild("ChangeVal"):FireServer(Player.bin.Employment, false)
  72. game.Workspace.RemoteEvents:FindFirstChild("RemoveObject"):FireServer(script.Parent.Parent.Parent)
  73. end)
  74. script.Parent.Parent.Discard.MouseButton1Click:connect(function()
  75. if not enabled1 or enabled then
  76. return
  77. end
  78. enabled1 = false
  79. game.Workspace.RemoteEvents:FindFirstChild("ValueRiseOrCut"):FireServer(Player.TextureGui.TextureId.Beli, 3750, 1)
  80. game.Workspace.RemoteEvents:FindFirstChild("ChangeVal"):FireServer(Player.bin.Shop, false)
  81. game.Workspace.RemoteEvents:FindFirstChild("ChangeVal"):FireServer(Player.bin.Employment, false)
  82. script.Parent.CashOut:Play()
  83. script.Parent.Parent.Parent.Enabled = false
  84. wait(1)
  85. game.Workspace.RemoteEvents:FindFirstChild("RemoveObject"):FireServer(script.Parent.Parent.Parent)
  86. end)
  87. end
  88.  
  89. onButtonClicked = function()
  90. if not enabled then
  91. return
  92. end
  93. enabled = false
  94. local RedeemCode = game.Workspace.RemoteEvents:FindFirstChild("DataBaseCheck"):InvokeServer("RedeemCode", "bin")
  95. if RedeemCode ~= Redeem then
  96. script.Parent.Parent.Parent:remove()
  97. print("Removed chest")
  98. end
  99. script.Parent.Parent.Parent.Text:remove()
  100. script.Parent.Parent.Text.Visible = true
  101. local rnd = 0
  102. local ClassName, Picture = nil, nil
  103. Weapon = "ImageLabel"
  104. for i = 1, 20 do
  105. for i = 1, 5 do
  106. wait(0.2 - i / 110)
  107. FrewCloud()
  108. end
  109. script.Parent.Sound:Play()
  110. if script.Parent:FindFirstChild(Weapon) then
  111. script.Parent:FindFirstChild(Weapon).Visible = false
  112. end
  113. math.randomseed(tick())
  114. for i = 1, 3 do
  115. rnd = math.random(1, 100)
  116. end
  117. if rnd < 7 then
  118. ClassName = "Legendary"
  119. Picture = Color3.fromRGB(245, 217, 0)
  120. else
  121. if rnd >= 7 and rnd < 27 then
  122. ClassName = "Famous"
  123. Picture = Color3.fromRGB(231, 71, 245)
  124. else
  125. if rnd >= 27 then
  126. ClassName = "Rare"
  127. Picture = Color3.fromRGB(47, 166, 245)
  128. end
  129. end
  130. end
  131. local rand = math.random(1, 93)
  132. if ClassName == "Legendary" then
  133. if rand < 18 then
  134. Weapon = "Newkama Kempo"
  135. else
  136. if rand >= 18 and rand < 36 then
  137. Weapon = "Double Vista`s Swords"
  138. else
  139. if rand >= 36 and rand < 54 then
  140. Weapon = "Shanks Saber"
  141. else
  142. if rand >= 54 and rand < 72 then
  143. Weapon = "Kitsunebi-ryu"
  144. else
  145. if rand >= 72 and rand < 89 then
  146. Weapon = "Rayleigh\'s Sword"
  147. else
  148. if rand >= 89 and rand < 92 then
  149. Weapon = "Yoru"
  150. else
  151. if rand >= 92 and rand < 95 then
  152. Weapon = "Shusui"
  153. else
  154. if rand >= 95 then
  155. Weapon = "Diable Jambe"
  156. end
  157. end
  158. end
  159. end
  160. end
  161. end
  162. end
  163. end
  164. else
  165. if ClassName == "Famous" then
  166. if rand < 10 then
  167. Weapon = "Om Sword"
  168. else
  169. if rand >= 10 and rand < 20 then
  170. Weapon = "Shiliew`s Nodati"
  171. else
  172. if rand >= 20 and rand < 30 then
  173. Weapon = "JaoKunDo"
  174. else
  175. if rand >= 30 and rand < 40 then
  176. Weapon = "Funkfreed"
  177. else
  178. if rand >= 40 and rand < 50 then
  179. Weapon = "Red Leg"
  180. else
  181. if rand >= 50 and rand < 60 then
  182. Weapon = "Oto and Kogarasi"
  183. else
  184. if rand >= 60 and rand < 70 then
  185. Weapon = "Hasshoken"
  186. else
  187. if rand >= 70 and rand < 80 then
  188. Weapon = "Ti Bon`s Sword"
  189. else
  190. if rand >= 80 and rand < 90 then
  191. Weapon = "Sandai Kitetsu"
  192. else
  193. if rand >= 90 and rand < 95 then
  194. Weapon = "Wado Ichimonji"
  195. else
  196. if rand >= 95 then
  197. Weapon = "Soul Solid"
  198. end
  199. end
  200. end
  201. end
  202. end
  203. end
  204. end
  205. end
  206. end
  207. end
  208. end
  209. else
  210. if ClassName == "Rare" then
  211. if rand < 10 then
  212. Weapon = "Kyros Longsword"
  213. else
  214. if rand >= 10 and rand < 20 then
  215. Weapon = "Jitte"
  216. else
  217. if rand >= 20 and rand < 30 then
  218. Weapon = "Kiribati"
  219. else
  220. if rand >= 30 and rand < 40 then
  221. Weapon = "Arlong`s Flintlock"
  222. else
  223. if rand >= 40 and rand < 50 then
  224. Weapon = "Mr. 5\'s Revolver"
  225. else
  226. if rand >= 50 and rand < 60 then
  227. Weapon = "Buggy`s Knifes"
  228. else
  229. if rand >= 60 and rand < 70 then
  230. Weapon = "Okama Kempo"
  231. else
  232. if rand >= 70 and rand < 80 then
  233. Weapon = "Axehand"
  234. else
  235. if rand >= 80 and rand < 90 then
  236. Weapon = "Alvida`s Iron Mace"
  237. else
  238. if rand >= 90 then
  239. Weapon = "Kuro Claws"
  240. end
  241. end
  242. end
  243. end
  244. end
  245. end
  246. end
  247. end
  248. end
  249. end
  250. end
  251. end
  252. end
  253. script.Parent.Parent.Text.Text = Weapon
  254. script.Parent.ImageColor3 = Picture
  255. if script.Parent:FindFirstChild(Weapon) then
  256. script.Parent:FindFirstChild(Weapon).Visible = true
  257. end
  258. script.Parent.Parent.Text.TextColor3 = Picture
  259. end
  260. script.Parent.Roll:Play()
  261. for i = 1, 100 do
  262. wait()
  263. FrewCloud()
  264. end
  265. script.Parent.Roll:Stop()
  266. script.Parent.OpenHihat:Play()
  267. if script.Parent:FindFirstChild(Weapon) then
  268. script.Parent:FindFirstChild(Weapon).Visible = false
  269. end
  270. math.randomseed(tick())
  271. for i = 1, 10 do
  272. rnd = math.random(1, 100)
  273. end
  274. if rnd < 3 then
  275. ClassName = "Legendary"
  276. Picture = Color3.fromRGB(245, 217, 0)
  277. else
  278. if rnd >= 3 and rnd < 19 then
  279. ClassName = "Famous"
  280. Picture = Color3.fromRGB(231, 71, 245)
  281. else
  282. if rnd >= 19 then
  283. ClassName = "Rare"
  284. Picture = Color3.fromRGB(47, 166, 245)
  285. end
  286. end
  287. end
  288. local rand = nil
  289. for i = 1, 10 do
  290. rand = math.random(1, 100)
  291. end
  292. if ClassName == "Legendary" then
  293. if rand < 18 then
  294. Weapon = "Newkama Kempo"
  295. else
  296. if rand >= 18 and rand < 36 then
  297. Weapon = "Double Vista`s Swords"
  298. if Player.TextureGui.TextureId.Race.Value == "Cyborg" then
  299. Weapon = "Reili`s Katana"
  300. end
  301. else
  302. if rand >= 36 and rand < 54 then
  303. Weapon = "Shanks Saber"
  304. else
  305. if rand >= 54 and rand < 72 then
  306. Weapon = "Kitsunebi-ryu"
  307. else
  308. if rand >= 72 and rand < 89 then
  309. Weapon = "Rayleigh\'s Sword"
  310. else
  311. if rand >= 89 and rand < 92 then
  312. Weapon = "Yoru"
  313. else
  314. if rand >= 92 and rand < 95 then
  315. Weapon = "Shusui"
  316. else
  317. if rand >= 95 then
  318. Weapon = "Diable Jambe"
  319. end
  320. end
  321. end
  322. end
  323. end
  324. end
  325. end
  326. end
  327. else
  328. if ClassName == "Famous" then
  329. if rand < 10 then
  330. Weapon = "Om Sword"
  331. else
  332. if rand >= 10 and rand < 20 then
  333. Weapon = "Shiliew`s Nodati"
  334. else
  335. if rand >= 20 and rand < 30 then
  336. Weapon = "JaoKunDo"
  337. else
  338. if rand >= 30 and rand < 40 then
  339. Weapon = "Funkfreed"
  340. else
  341. if rand >= 40 and rand < 50 then
  342. Weapon = "Red Leg"
  343. else
  344. if rand >= 50 and rand < 60 then
  345. Weapon = "Oto and Kogarasi"
  346. if Player.TextureGui.TextureId.Race.Value == "Cyborg" then
  347. Weapon = "Sandai Kitetsu"
  348. end
  349. else
  350. if rand >= 60 and rand < 70 then
  351. Weapon = "Hasshoken"
  352. else
  353. if rand >= 70 and rand < 80 then
  354. Weapon = "Ti Bon`s Sword"
  355. else
  356. if rand >= 80 and rand < 90 then
  357. Weapon = "Sandai Kitetsu"
  358. else
  359. if rand >= 90 and rand < 95 then
  360. Weapon = "Wado Ichimonji"
  361. else
  362. if rand >= 95 then
  363. Weapon = "Soul Solid"
  364. end
  365. end
  366. end
  367. end
  368. end
  369. end
  370. end
  371. end
  372. end
  373. end
  374. end
  375. else
  376. if ClassName == "Rare" then
  377. if rand < 10 then
  378. Weapon = "Kyros Longsword"
  379. else
  380. if rand >= 10 and rand < 20 then
  381. Weapon = "Jitte"
  382. else
  383. if rand >= 20 and rand < 30 then
  384. Weapon = "Kiribati"
  385. else
  386. if rand >= 30 and rand < 40 then
  387. Weapon = "Arlong`s Flintlock"
  388. else
  389. if rand >= 40 and rand < 50 then
  390. Weapon = "Mr. 5\'s Revolver"
  391. else
  392. if rand >= 50 and rand < 60 then
  393. Weapon = "Buggy`s Knifes"
  394. else
  395. if rand >= 60 and rand < 70 then
  396. Weapon = "Okama Kempo"
  397. else
  398. if rand >= 70 and rand < 80 then
  399. Weapon = "Axehand"
  400. else
  401. if rand >= 80 and rand < 90 then
  402. Weapon = "Alvida`s Iron Mace"
  403. else
  404. if rand >= 90 then
  405. Weapon = "Kuro Claws"
  406. if Player.TextureGui.TextureId.Race.Value == "Cyborg" then
  407. Weapon = "Axehand"
  408. end
  409. end
  410. end
  411. end
  412. end
  413. end
  414. end
  415. end
  416. end
  417. end
  418. end
  419. end
  420. end
  421. end
  422. script.Parent.ImageColor3 = Picture
  423. if script.Parent:FindFirstChild(Weapon) then
  424. script.Parent:FindFirstChild(Weapon).Visible = true
  425. end
  426. script.Parent.EndSound:Play()
  427. script.Parent.Parent.Text.TextColor3 = Picture
  428. script.Parent.Parent.Text.Text = Weapon
  429. script.Parent.Parent.Accept.Visible = true
  430. script.Parent.Parent.Discard.Visible = true
  431. FinalButton(Weapon)
  432. end
  433.  
  434. script.Parent.MouseButton1Click:connect(onButtonClicked)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement