Anonymouse10101

Case Clicker Script Op

May 26th, 2019
479
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.85 KB | None | 0 0
  1. -- Check for Functions --
  2. if(not ((make_writeable or setreadonly) and getsenv and debug.getmetatable and debug.getupvalues)) then
  3. game.StarterGui:SetCore("SendNotification", {
  4. Title = "Case Clicker GUI by Luaa",
  5. Text = "Sorry, but your exploit is not supported.",
  6. Duration = 5,
  7. Button1 = "Close :("
  8. });
  9. return
  10. end
  11.  
  12. -- Variables --
  13. local env = getsenv(game:GetService("Players").LocalPlayer.PlayerGui["Game GUI"]["Client Controller"])
  14. local upvalues = debug.getupvalues(env.addItem)
  15. local replicatedStorage = game:GetService("ReplicatedStorage")
  16. local remotes = replicatedStorage["Game Objects"].Remotes
  17. local networkEvent = nil;
  18. local networkFunction = nil;
  19. local addToMarket = upvalues["addToMarket"]
  20. local controlItem = upvalues["controlItem"]
  21. local privateKey = nil;
  22. local logLevels = {
  23. Info = Color3.fromRGB(255, 255, 255),
  24. Warning = Color3.fromRGB(255, 247, 134),
  25. Error = Color3.fromRGB(255, 41, 34),
  26. Success = Color3.fromRGB(118, 255, 55)
  27. }
  28. local guiInstances = {}
  29. local buxFarmActive = false
  30.  
  31. -- Creates GUI --
  32. function createInstance(instance, name, parent)
  33. local inst = Instance.new(instance)
  34. if(parent ~= nil) then
  35. inst.Parent = parent
  36. end
  37. guiInstances[name] = inst
  38. return inst
  39. end
  40.  
  41. function createGui()
  42. local screenGui = createInstance("ScreenGui", "screenGui", game:GetService("Players").LocalPlayer.PlayerGui)
  43. local mainFrame = createInstance("Frame", "mainFrame", screenGui)
  44. mainFrame.BackgroundColor3 = Color3.fromRGB(38, 38, 38)
  45. mainFrame.BorderColor3 = Color3.fromRGB(255, 255, 255)
  46. mainFrame.BorderSizePixel = 1
  47. mainFrame.Position = UDim2.new(1, -320, 1, -270)
  48. mainFrame.Size = UDim2.new(0, 300, 0, 20)
  49. mainFrame.Draggable = true
  50. mainFrame.Active = true
  51. mainFrame.Selectable = true
  52. local header = createInstance("Frame", "header", mainFrame)
  53. header.BackgroundColor3 = Color3.fromRGB(38, 38, 38)
  54. header.BorderColor3 = Color3.fromRGB(255, 255, 255)
  55. header.BorderSizePixel = 1
  56. header.Position = UDim2.new(0, 0, -0.001, 0)
  57. header.Size = UDim2.new(0, 300, 0, 20)
  58. local headerTitle = createInstance("TextLabel", "headerTitle", header)
  59. headerTitle.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  60. headerTitle.BackgroundTransparency = 1
  61. headerTitle.Position = UDim2.new(0, 0, 0.01, 0)
  62. headerTitle.Size = UDim2.new(0, 166, 0, 19)
  63. headerTitle.Font = Enum.Font.GothamBold
  64. headerTitle.Text = " Case Clickers GUI"
  65. headerTitle.TextColor3 = Color3.fromRGB(255, 255, 255)
  66. headerTitle.TextSize = 10
  67. headerTitle.TextXAlignment = Enum.TextXAlignment.Left
  68. local headerCredits = createInstance("TextLabel", "headerCredits", header)
  69. headerCredits.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  70. headerCredits.BackgroundTransparency = 1
  71. headerCredits.Position = UDim2.new(0.77, 0, 0.26, 0)
  72. headerCredits.Size = UDim2.new(0, 68, 0, 9)
  73. headerCredits.Font = Enum.Font.GothamBold
  74. headerCredits.Text = "By Luaa"
  75. headerCredits.TextColor3 = Color3.fromRGB(255, 255, 255)
  76. headerCredits.TextSize = 10
  77. wait(2)
  78. mainFrame:TweenSize(UDim2.new(0, 300, 0, 250))
  79. local footer = createInstance("Frame", "footer", mainFrame)
  80. footer.BackgroundColor3 = Color3.fromRGB(38, 38, 38)
  81. footer.BorderColor3 = Color3.fromRGB(255, 255, 255)
  82. footer.BorderSizePixel = 1
  83. footer.Position = UDim2.new(-0.067, 20, 0.92, 0)
  84. footer.Size = UDim2.new(0, 300, 0, 20)
  85. local footerTitle = createInstance("TextLabel", "footerTitle", footer)
  86. footerTitle.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  87. footerTitle.BackgroundTransparency = 1
  88. footerTitle.Position = UDim2.new(0, 0, 0.01, 0)
  89. footerTitle.Size = UDim2.new(0, 300, 0, 19)
  90. footerTitle.Font = Enum.Font.GothamBold
  91. footerTitle.Text = "Press the \"Click for BUX\" button."
  92. footerTitle.TextColor3 = Color3.fromRGB(255, 247, 134)
  93. footerTitle.TextSize = 10
  94. wait(2)
  95. local skipAnimation = createInstance("TextButton", "skipAnimation", mainFrame)
  96. skipAnimation.Position = UDim2.new(0.03, 0, 0.12, 0)
  97. skipAnimation.Size = UDim2.new(0, 100, 0, 50)
  98. skipAnimation.Style = Enum.ButtonStyle.RobloxRoundDropdownButton
  99. skipAnimation.Font = Enum.Font.GothamBold
  100. skipAnimation.Text = "Skip Animation"
  101. skipAnimation.TextSize = 10
  102. local buxFarm = createInstance("TextButton", "buxFarm", mainFrame)
  103. buxFarm.Position = UDim2.new(0.643, 0, 0.12, 0)
  104. buxFarm.Size = UDim2.new(0, 100, 0, 50)
  105. buxFarm.Style = Enum.ButtonStyle.RobloxRoundDropdownButton
  106. buxFarm.Font = Enum.Font.GothamBold
  107. buxFarm.Text = "Bux Farm"
  108. buxFarm.TextSize = 10
  109. local openCases = createInstance("TextButton", "openCases", mainFrame)
  110. openCases.Position = UDim2.new(0.03, 0, 0.352, 0)
  111. openCases.Size = UDim2.new(0, 100, 0, 50)
  112. openCases.Style = Enum.ButtonStyle.RobloxRoundDropdownButton
  113. openCases.Font = Enum.Font.GothamBold
  114. openCases.Text = "Open Cases"
  115. openCases.TextSize = 10
  116. --[[
  117. local caseBot = createInstance("TextButton", "caseBot", mainFrame)
  118. caseBot.Position = UDim2.new(0.643, 0, 0.352, 0)
  119. caseBot.Size = UDim2.new(0, 100, 0, 50)
  120. caseBot.Style = Enum.ButtonStyle.RobloxRoundDropdownButton
  121. caseBot.Font = Enum.Font.GothamBold
  122. caseBot.Text = "Case Bot"
  123. caseBot.TextSize = 10
  124. --]]
  125. local casesAmount = createInstance("TextBox", "casesAmount", mainFrame)
  126. casesAmount.Position = UDim2.new(0.03, 0, 0.78, 0)
  127. casesAmount.Size = UDim2.new(0, 127, 0, 22)
  128. casesAmount.BackgroundColor3 = Color3.fromRGB(38, 38, 38)
  129. casesAmount.BorderColor3 = Color3.fromRGB(255, 255, 255)
  130. casesAmount.BorderSizePixel = 1
  131. casesAmount.PlaceholderText = "Amount of Cases"
  132. casesAmount.Text = ""
  133. casesAmount.TextColor3 = Color3.fromRGB(255, 255, 255)
  134. local caseType = createInstance("TextBox", "caseType", mainFrame)
  135. caseType.Position = UDim2.new(0.553, 0, 0.78, 0)
  136. caseType.Size = UDim2.new(0, 127, 0, 22)
  137. caseType.BackgroundColor3 = Color3.fromRGB(38, 38, 38)
  138. caseType.BorderColor3 = Color3.fromRGB(255, 255, 255)
  139. caseType.BorderSizePixel = 1
  140. caseType.PlaceholderText = "Case Type"
  141. caseType.Text = ""
  142. caseType.TextColor3 = Color3.fromRGB(255, 255, 255)
  143. end
  144.  
  145. function log(text, colour)
  146. guiInstances["footerTitle"].TextColor3 = colour
  147. guiInstances["footerTitle"].Text = text
  148. end
  149.  
  150. -- Metatable Magic --
  151. function metatableMagic()
  152. -- Variables --
  153. local metatable = debug.getmetatable(game)
  154. local backupNamecall = metatable.__namecall
  155.  
  156. -- Make randomizeRemotes do nothing --
  157. env.RandomizeRemotes = function() end
  158.  
  159. -- Make metatable not readonly --
  160. local setreadonly = make_writeable or setreadonly
  161. setreadonly(metatable, false)
  162.  
  163. -- Overwrite __namecall metamethod --
  164. metatable.__namecall = function(...)
  165. local args = {...}
  166. if(args[#args] == "FireServer" and networkEvent == nil and args[1].Parent == remotes) then
  167. privateKey = args[4]
  168. networkEvent = args[1]
  169. if(not networkFunction) then
  170. log("Network Event has been found, now open a case.", logLevels["Success"])
  171. else
  172. log("Network Event has been found, you may now use the gui.", logLevels["Success"])
  173. end
  174. elseif(args[#args] == "InvokeServer" and networkFunction == nil and args[1].Parent == remotes) then
  175. networkFunction = args[1]
  176. if(not networkEvent) then
  177. log("Net Function has been found, click the \"Click for BUX\" button.", logLevels["Success"])
  178. else
  179. log("Network Function has been found, you may use the gui.", logLevels["Success"])
  180. end
  181. elseif(args[#args] == "UserOwnsGamePassAsync") then
  182. return true
  183. elseif(args[#args] == "Kick") then
  184. return true
  185. end
  186. return backupNamecall(...)
  187. end
  188. end
  189.  
  190. metatableMagic()
  191. createGui()
  192.  
  193. guiInstances["skipAnimation"].MouseButton1Click:Connect(function()
  194. local ccEnv = getsenv(game:GetService("Players").LocalPlayer.PlayerGui["Game GUI"]["Client Controller"])
  195. debug.setupvalue(ccEnv.updateClient, "hasPass", true)
  196. debug.setupvalue(ccEnv.updateClient, "skip_enabled", true)
  197. log("Enabled Skip Animation.", logLevels["Success"])
  198. end)
  199.  
  200. guiInstances["buxFarm"].MouseButton1Click:Connect(function()
  201. if(buxFarmActive) then
  202. buxFarmActive = false
  203. log("Stopped Bux farm.", logLevels["Success"])
  204. else
  205. buxFarmActive = true
  206.  
  207. if(networkEvent) then
  208. log("Started Bux Farm.", logLevels["Success"])
  209. while buxFarmActive do
  210. wait()
  211. networkEvent:FireServer("Click", {}, privateKey)
  212. end
  213. else
  214. log("Event has not been found, click \"Click for BUX\" button.", logLevels["Error"])
  215. end
  216. end
  217. end)
  218.  
  219. guiInstances["openCases"].MouseButton1Click:Connect(function()
  220. local amount = guiInstances["casesAmount"].Text
  221. local type = guiInstances["caseType"].Text
  222.  
  223. if(tonumber(amount) ~= nil and type ~= "") then
  224. if(networkFunction) then
  225. log("Started Case Opener.", logLevels["Success"])
  226. for i=0, tonumber(amount) do
  227. log("Opening Case: " .. i, logLevels["Success"])
  228. networkFunction:InvokeServer("OpenCase", {type, true}, privateKey)
  229. wait(0.5)
  230. end
  231. else
  232. log("Network Function has not been found, open a case.", logLevels["Error"])
  233. end
  234. else
  235. log("You have not entered a number or type.", logLevels["Error"])
  236. end
  237. end)
  238.  
  239. --[[
  240. local itemJSON = require(game.ReplicatedStorage.Modules.CollectiblesJSON)
  241. function getType(assetId)
  242. return itemJSON[tostring(assetId)] and itemJSON[tostring(assetId)].Type or "Common"
  243. end
  244. function getPrice(assetId)
  245. local val = game.ReplicatedStorage.PriceData:FindFirstChild(assetId)
  246. return val and val.Value or 0
  247. end
  248.  
  249. Works but unfinished.
  250.  
  251. guiInstances["caseBot"].MouseButton1Click:Connect(function()
  252. if(networkFunction) then
  253. while wait() do
  254. local caseData, items, winningNumber, caseSpeed = networkFunction:InvokeServer("OpenCase", {"Legendary", true}, privateKey)
  255. wait(0.2)
  256. if(caseData) then
  257. local itemType = getType(items[winningNumber].AssetId)
  258. if((itemType:upper() ~= "OMEGA" or itemType:upper() ~= "LEGENDARY") and 300000 > tonumber(getPrice(items[winningNumber].AssetId))) then
  259. controlItem:FireServer(items[winningNumber].AssetId, "Sell")
  260. end
  261. end
  262. wait(0.5)
  263. end
  264. else
  265. log("Network Function has not been found, open a case.", logLevels["Error"])
  266. end
  267. end)
  268. --]]
Add Comment
Please, Sign In to add comment