Advertisement
ScriptHubRoblox

farmc

Dec 2nd, 2022
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.02 KB | None | 0 0
  1. -- item spawn bypass --
  2. _G.itemHook = _G.itemHook or hookmetamethod(game, '__newindex', function(self, key, val)
  3. if self.Name == 'ItemSpawn' and key == 'OnClientInvoke' then
  4. _G.spawnFunc = val
  5. _G.funcReturn = getconstants(val)[3]
  6. print('item hack loaded')
  7. u1 = {}
  8. funcfor = function(arg1, list)
  9. if not u1[list.CD] then
  10. u1[list.CD] = true
  11. --print('Item added',list.Replica)
  12. local clon = list.Replica:Clone()
  13. clon.Parent = game:GetService("Workspace")["Item_Spawns"].Items
  14. clon.Base.CFrame = list.CFrame
  15. list.CD.Parent = clon
  16. local v30 = list.CD:Clone()
  17. v30.Enabled = true
  18. v30.Parent = clon
  19. v30.Name = 'RightPrompt'
  20. u8 = {}
  21. u8[1] = v30.Triggered:Connect(function(p2)
  22. list.CD.RemoteEvent:FireServer()
  23. end)
  24. local function v31()
  25. if not u1[list.CD] then
  26. return
  27. end
  28. u1[list.CD] = nil
  29. if clon then
  30. clon:Destroy()
  31. end
  32. if list.CD then
  33. list.CD:Destroy()
  34. end
  35. end
  36. u8[2] = clon.ChildRemoved:Connect(function(p3)
  37. if p3 == list.CD or not list.CD or not list.CD.Parent then
  38. v31();
  39. end;
  40. end)
  41. end
  42. return _G.funcReturn
  43. end
  44. return _G.itemHook(self, key, funcfor)
  45. end
  46. return _G.itemHook(self, key, val)
  47. end)
  48.  
  49. -- Loading skip --
  50. while not game:IsLoaded() do wait() end
  51. while true do
  52. for i,v in pairs(game:GetService("Players").LocalPlayer:WaitForChild('PlayerGui'):GetDescendants()) do
  53. if v.Name == 'TextButton' and v.Parent.Name == 'Skip' then
  54. loading = v
  55. end
  56. end
  57. if loading then break end
  58. end
  59. while #getconnections(loading.MouseButton1Click) == 0 do wait() end
  60. for i,v in pairs(getconnections(loading.MouseButton1Click)) do v.Function() end
  61. while true do
  62. for i,v in pairs(game:GetService("Players").LocalPlayer:WaitForChild('PlayerGui'):GetDescendants()) do
  63. if v.Name == 'Play' and v.Parent.Name == 'LoadingScreen' then
  64. playbtn = v
  65. end
  66. end
  67. if playbtn then break end
  68. end
  69. while #getconnections(playbtn.MouseButton1Click) == 0 do wait() end
  70. for i,v in pairs(getconnections(playbtn.MouseButton1Click)) do v.Function() end
  71.  
  72. -- Constants --
  73. lplr = game.Players.LocalPlayer
  74. _G.ayb = _G.ayb and _G.ayb + 1 or 1
  75. session = _G.ayb
  76. itemsCountInBackpack = {
  77. ["Mysterious Bow"] = 10,
  78. ["Gold Coin"] = 45,
  79. ["Pure Rokakaka"] = 10,
  80. ["Bottle of Blood"] = 3,
  81. ["Quinton's Glove"] = 10,
  82. ["Stone Mask"] = 10,
  83. ["Mysterious Arrow"] = 25,
  84. ["Rib Cage of The Saint's Corpse"] = 10,
  85. ["Steel Ball"] = 10,
  86. ["Dio's Diary"] = 10,
  87. ["Ancient Scroll"] = 10,
  88. ["Zepellin's Headband"] = 10,
  89. ["Left Arm of The Saint's Corpse"] = 10,
  90. ["Dio's Bone"] = 10,
  91. ["Lucky Arrow"] = 10,
  92. ["Diamond"] = 30,
  93. ["Rokakaka"] = 25,
  94. ["Red Candy"] = 40,
  95. ["Blue Candy"] = 40,
  96. ["Green Candy"] = 40,
  97. ["Yellow Candy"] = 40,
  98. ["Christmas Present"] = 10,
  99. }
  100.  
  101. -- Functions --
  102. function checkItem(item)
  103. for _,object in pairs(item:GetChildren()) do
  104. if object:IsA('BasePart') and object.Transparency < 1 then
  105. return object
  106. end
  107. end
  108. return false
  109. end
  110.  
  111. function takeItem(item)
  112. game:GetService("Players").LocalPlayer.Character.RemoteEvent:FireServer("InputBegan", {["Input"] = Enum.KeyCode.E})
  113. wait(0.2)
  114. for _,object in pairs(item:GetChildren()) do
  115. if object.ClassName == 'ProximityPrompt' and object.Enabled then
  116. fireproximityprompt(object, 0)
  117. return
  118. end
  119. end
  120. game:GetService("Players").LocalPlayer.Character.RemoteEvent:FireServer("InputEnded", {["Input"] = Enum.KeyCode.E})
  121. end
  122.  
  123. function countItems()
  124. local items = {}
  125. for i,v in pairs(lplr.Backpack:GetChildren()) do
  126. items[v.Name] = items[v.Name] and items[v.Name] + 1 or 1
  127. end
  128. setmetatable(items, {__index = function() return 0 end})
  129. return items
  130. end
  131.  
  132. function serverHop()
  133. placeId = game.PlaceId
  134. function findTeleport()
  135. local nextCursor;
  136. while true do
  137. if nextCursor == 'end' then
  138. break
  139. elseif not nextCursor then
  140. nextCursor = ''
  141. end
  142. print('Finding server...')
  143. url = 'https://games.roblox.com/v1/games/'..tostring(placeId)..'/servers/Public?sortOrder=Desc&excludeFullGames=true&limit=100&cursor='..nextCursor
  144. local request = game:HttpGet(url)
  145. local jsonDecode = game:GetService("HttpService"):JSONDecode(request)
  146. nextCursor = jsonDecode.nextPageCursor
  147. if not nextCursor then
  148. nextCursor = 'end'
  149. end
  150. local data = jsonDecode.data
  151. for i,v in pairs(data) do
  152. if not oldServers[v.id] then
  153. serverId = v.id
  154. end
  155. end
  156. if serverId then
  157. print('New server: '..serverId)
  158. game:GetService('TeleportService'):TeleportToPlaceInstance(placeId, serverId, game.Players.LocalPlayer, nil, oldServers)
  159. break
  160. end
  161. end
  162. end
  163.  
  164. oldServers = game:GetService('TeleportService'):GetLocalPlayerTeleportData() or {}
  165. oldServers[game.JobId] = true
  166. findTeleport()
  167. if not serverId then
  168. oldServers = {[game.JobId] = true}
  169. findTeleport()
  170. end
  171. if not serverId then
  172. oldServers = {}
  173. findTeleport()
  174. end
  175. end
  176.  
  177. -- Tp Bypass --
  178. _G.old = _G.old or hookmetamethod(game,"__namecall", function(self,...)
  179. local args = {...}
  180. local method = getnamecallmethod()
  181. if tostring(self) == "Returner" and tostring(method) == "InvokeServer" then
  182. return " ___XP DE KEY"
  183. end
  184. return _G.old(self, ...)
  185. end)
  186.  
  187. -- Main --
  188. spawn(function()
  189. inServer = true
  190. wait(inf)
  191. while wait() do
  192. local itemsCheck = false
  193. for _,item in pairs(game.Workspace.Item_Spawns.Items:GetChildren()) do
  194. if itemsForFarm[item.Name] then
  195. itemsCheck = true
  196. end
  197. end
  198. if not itemsCheck then
  199. break
  200. end
  201. end
  202. inServer = false
  203. end)
  204.  
  205. while wait() and inServer and session == _G.ayb do
  206. for _,item in pairs(game.Workspace.Item_Spawns.Items:GetChildren()) do
  207. if itemsForFarm[item.Name] and countItems()[item.Name] < itemsCountInBackpack[item.Name] then
  208. local object = checkItem(item)
  209. if object and session == _G.ayb then
  210. lplr.Character.HumanoidRootPart.CFrame = object.CFrame
  211. wait(0.8)
  212. takeItem(item)
  213. wait(0.8)
  214. end
  215. end
  216. end
  217. end
  218.  
  219. if session == _G.ayb then
  220. serverHop()
  221. end
  222.  
  223. end -- for placeid check
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement