Advertisement
antraxo90

Untitled

Apr 23rd, 2019
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.97 KB | None | 0 0
  1.  
  2. getgenv().whitelisted = {
  3. ["rare"] = true,
  4. ["epic"] = true,
  5. ["legendary"] = true,
  6. ["uncommon"] = true,
  7. }
  8.  
  9. getgenv().whitelistednames = {
  10. ["Beastmaster War Scythe"] = true,
  11. ["Blade Throw"] = true,
  12. }
  13.  
  14. getgenv().DungeonName = "King's Castle"
  15. getgenv().Difficulty = "Nightmare"
  16.  
  17. wait(12)
  18. local Event = game:GetService("ReplicatedStorage").remotes.loadPlayerCharacter
  19. Event:FireServer()
  20.  
  21. local Event = game:GetService("ReplicatedStorage").DefaultSoundEvents.AddCharacterLoadedEvent
  22. Event:FireServer()
  23. local Event = game:GetService("ReplicatedStorage").remotes.reloadInvy
  24. Event:InvokeServer()
  25.  
  26. wait(2)
  27.  
  28. game.ReplicatedStorage.remotes.createLobby:InvokeServer(getgenv().DungeonName, getgenv().Difficulty, 120, true, false)
  29.  
  30. wait(10)
  31. local player = game:service'Players'.LocalPlayer
  32. local slotsFrame = game:service'Players'.LocalPlayer.PlayerGui:FindFirstChild("inventory"):FindFirstChild("mainBackground"):FindFirstChild("innerBackground"):FindFirstChild("rightSideFrame"):FindFirstChild("slotsFrame")
  33.  
  34. local getPlayerInvy = function(player)
  35. return game.ReplicatedStorage.remotes.reloadInvy:InvokeServer()
  36. end
  37. local getCertainItem = function(inventory, itemType, uniqueNum)
  38. if itemType == "weapon" then
  39. for weaponIdNum, weaponStats in pairs(inventory.weapons) do
  40. if tonumber(string.sub(weaponIdNum, 8)) == uniqueNum then
  41. return weaponStats
  42. end
  43. end
  44. elseif itemType == "ability" then
  45. for abilityIdNum, abilityStats in pairs(inventory.abilities) do
  46. if tonumber(string.sub(abilityIdNum, 9)) == uniqueNum then
  47. return abilityStats
  48. end
  49. end
  50. elseif itemType == "chest" then
  51. for chestIdNum, chestStats in pairs(inventory.chests) do
  52. if tonumber(string.sub(chestIdNum, 7)) == uniqueNum then
  53. return chestStats
  54. end
  55. end
  56. elseif itemType == "helmet" then
  57. for helmetIdNum, helmetStats in pairs(inventory.helmets) do
  58. if tonumber(string.sub(helmetIdNum, 8)) == uniqueNum then
  59. return helmetStats
  60. end
  61. end
  62. elseif itemType == "pet" then
  63. end
  64. end
  65.  
  66. for i = 1, 5 do
  67. for i,v in pairs(slotsFrame:GetChildren()) do
  68. if v:IsA("ImageLabel") then
  69. if v.itemType.Value == "weapon" then
  70. local inventory = getPlayerInvy(player)
  71. local item = getCertainItem(inventory, "weapon", v.itemType.uniqueItemNum.Value)
  72. --print(item.physicalDamage)
  73. for g,l in pairs(item) do
  74. if not getgenv().whitelisted[item.rarity] and not getgenv().whitelistednames[item.name] then
  75. print("would have sold: "..item.name)
  76. local tempUniqueId = v.itemType.uniqueItemNum.Value
  77. game.ReplicatedStorage.remotes.sellItemEvent:FireServer("weapon", tempUniqueId)
  78. end
  79. end
  80. end
  81. end
  82. end
  83. wait()
  84. end
  85.  
  86. for i = 1, 5 do
  87. for i,v in pairs(slotsFrame:GetChildren()) do
  88. if v:IsA("ImageLabel") then
  89. if v.itemType.Value == "chest" then
  90. local inventory = getPlayerInvy(player)
  91. local item = getCertainItem(inventory, "chest", v.itemType.uniqueItemNum.Value)
  92. --print(item.physicalDamage)
  93. for g,l in pairs(item) do
  94. if not getgenv().whitelisted[item.rarity] and not getgenv().whitelistednames[item.name] then
  95. print("would have sold: "..item.name)
  96. local tempUniqueId = v.itemType.uniqueItemNum.Value
  97. game.ReplicatedStorage.remotes.sellItemEvent:FireServer("chest", tempUniqueId)
  98. end
  99. end
  100. end
  101. end
  102. end
  103. wait()
  104. end
  105.  
  106. for i = 1, 5 do
  107. for i,v in pairs(slotsFrame:GetChildren()) do
  108. if v:IsA("ImageLabel") then
  109. if v.itemType.Value == "helmet" then
  110. local inventory = getPlayerInvy(player)
  111. local item = getCertainItem(inventory, "helmet", v.itemType.uniqueItemNum.Value)
  112. --print(item.physicalDamage)
  113. for g,l in pairs(item) do
  114. if not getgenv().whitelisted[item.rarity] and not getgenv().whitelistednames[item.name] then
  115. print("would have sold: "..item.name)
  116. local tempUniqueId = v.itemType.uniqueItemNum.Value
  117. game.ReplicatedStorage.remotes.sellItemEvent:FireServer("helmet", tempUniqueId)
  118. end
  119. end
  120. end
  121. end
  122. end
  123. wait()
  124. end
  125.  
  126. for i = 1, 5 do
  127. for i,v in pairs(slotsFrame:GetChildren()) do
  128. if v:IsA("ImageLabel") then
  129. if v.itemType.Value == "ability" then
  130. local inventory = getPlayerInvy(player)
  131. local item = getCertainItem(inventory, "ability", v.itemType.uniqueItemNum.Value)
  132. --print(item.physicalDamage)
  133. for g,l in pairs(item) do
  134. if not getgenv().whitelisted[item.rarity] and not getgenv().whitelistednames[item.name] then
  135. print("would have sold: "..item.name)
  136. local tempUniqueId = v.itemType.uniqueItemNum.Value
  137. game.ReplicatedStorage.remotes.sellItemEvent:FireServer("ability", tempUniqueId)
  138. end
  139. end
  140. end
  141. end
  142. end
  143. wait()
  144. end
  145. wait(1)
  146. game.ReplicatedStorage.remotes.startDungeon:FireServer()
  147.  
  148. wait(12)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement