Advertisement
NukeVsCity

item farm , put in autoexec

Aug 11th, 2021
9,889
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.53 KB | None | 0 0
  1. while true do
  2. wait(20) -- How any seconds before re-executing it
  3. local ws = workspace;
  4. local lp = game.Players.LocalPlayer;
  5.  
  6. _G.itemFarm = true;
  7. _G.foundItem = false; --Dont touch
  8. _G.grabbingItem = false;
  9. _G.space = true;
  10. _G.itemsToSkip = {};
  11.  
  12. --TP Bypass starts here
  13. --This is used to get the return key in case they change it
  14. local gc = getgc(true);
  15. local key = nil;
  16. for i = #gc, 1, -1 do
  17. if type(gc[i]) == "table" then
  18. if rawget(gc[i], "A") and type(rawget(gc[i], "A")) == "table" and #(rawget(gc[i], "A")) > 2 then
  19. key = rawget(gc[i], "A")[2];
  20. break;
  21. end
  22. end
  23. end
  24.  
  25. local old;
  26. old = hookmetamethod(game, "__namecall", function(self, ...)
  27. local args = {...};
  28. if not checkcaller() and getnamecallmethod() == "InvokeServer" and tostring(self) == "Returner" and args[1] == "idklolbrah2de" then
  29. if key then return key;
  30. else return " ___XP DE KEY"; end
  31. end
  32. if not checkcaller() and getnamecallmethod() == "InvokeServer" and args[1] == "Reset" then
  33. return;
  34. end
  35. if not checkcaller() and getnamecallmethod() == "FireServer" and args[1] == "Reset" then
  36. return;
  37. end
  38. if not checkcaller() and getnamecallmethod() == "Kick" then
  39. return;
  40. end
  41. return old(self, ...);
  42. end);
  43.  
  44. function srchTable(tbl, index)
  45. local newTBL = {};
  46. for i,v in pairs(tbl) do
  47. table.insert(newTBL, tostring(v));
  48. end
  49. if table.find(newTBL, index) then
  50. newTBL = nil;
  51. return true;
  52. end
  53. return false;
  54. end
  55.  
  56. (function()
  57. for i,v in pairs(getgc()) do
  58. if type(v) == "function" and tostring(getfenv(v).script) == 'Client' and #debug.getprotos(v) == 7 and srchTable(debug.getupvalues(v), "RemoteEvent") then
  59. hookfunction(v, function()
  60. return wait(9e9);
  61. end);
  62. break;
  63. end
  64. end
  65. end)();
  66. --TP Bypass ends here
  67.  
  68. local oldPos = lp.Character.HumanoidRootPart.CFrame;
  69. lp.Character.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(1750.6010742188, 770.61102294922, 50));
  70. wait(0.5);
  71. lp.Character.LowerTorso.Root:Destroy();
  72. wait(0.5);
  73. lp.Character.HumanoidRootPart.CFrame = oldPos;
  74. wait(0.5);
  75.  
  76. --Hide Character starts here
  77. coroutine.wrap(function()
  78. while wait() do
  79. if (lp.Character and lp.Character:FindFirstChild("Humanoid")) and lp.Character:FindFirstChild("Head") then
  80. lp.Character.Humanoid.NameDisplayDistance = 0;
  81. for i,v in pairs(lp.Character:GetChildren()) do
  82. if v:IsA("Accessory") or v:IsA("Pants") or v:IsA("Shirt") then
  83. v:Destroy();
  84. end
  85. end
  86. if lp.Character.Head:FindFirstChild("face") then lp.Character.Head.face:Destroy(); end
  87. end
  88. end
  89. end)();
  90. --Hide Character ends here
  91.  
  92. --Coords I took from https://discord.gg/rs9FCkMX5u
  93. local itemSpawns =
  94. {
  95. CFrame.new(-413.53112792969, 827.54278564453, 42.011169433594),
  96. CFrame.new(-191.24629211426 ,827.0869140625 , -10.055070877075),
  97. CFrame.new(-282.28414916992 ,826.04718017578 , -26.729415893555),
  98. CFrame.new(-205.62605285645 ,829.04846191406 , -67.532608032227),
  99. CFrame.new(-154.98663330078 ,829.00830078125 , -52.219764709473),
  100. CFrame.new(-89.047630310059 ,830.90832519531 , -66.026138305664),
  101. CFrame.new(826.30889892578 ,803.84655761719 , -226.66427612305),
  102. CFrame.new(699.22119140625 ,803.84655761719 , -208.68244934082),
  103. CFrame.new(776.76434326172 ,807.17486572266 ,-355.8134765625),
  104. CFrame.new(1050.7122802734 ,803.84729003906 ,-296.76510620117),
  105. CFrame.new(809.83520507812 ,803.84655761719 ,-81.491226196289),
  106. CFrame.new(796.341796875 ,810.68719482422 , -40.994129180908),
  107. CFrame.new(836.11309814453 ,810.33142089844 ,-41.200565338135),
  108. CFrame.new(1051.7955322266 ,815.47772216797 ,-25.381820678710001),
  109. CFrame.new(1915.4926757812 ,822.24658203125 ,-39.561851501465),
  110. CFrame.new(1985.0435791016 ,819.84655761719 ,-189.87425231934),
  111. CFrame.new(2341.68359375 ,819.84655761719 ,-228.87698364258),
  112. CFrame.new(305.22045898438 ,803.84655761719 ,-185.82682800293),
  113. CFrame.new(339.23501586914 ,826.84722900391 ,-110.79901123047),
  114. CFrame.new(409.59423828125 ,826.64733886719 ,-89.112976074219),
  115. CFrame.new(453.85363769531 ,826.64733886719 ,115.3904876709),
  116. CFrame.new(428.88458251953 ,861.05114746094 ,-175.99559020996),
  117. CFrame.new(124.43515014648 ,826.84722900391 ,-153.63478088379),
  118. CFrame.new(222.72418212891 ,827.80584716797 , -85.74934387207),
  119. CFrame.new(130.63851928711 ,826.84704589844 ,-49.86185836792),
  120. CFrame.new(46.80810546875 ,826.84698486328 ,-98.422576904297),
  121. CFrame.new(27.974872589111 ,861.29296875 ,-10.053286552429),
  122. CFrame.new(375.23657226562 ,826.84704589844 ,-162.12173461914),
  123. CFrame.new(341.62973022461 ,826.84704589844 ,-131.64344787598),
  124. CFrame.new(479.29449462891 ,826.84716796875 ,254.90055847168),
  125. CFrame.new(452.22775268555 ,826.84716796875 ,302.7751159668),
  126. CFrame.new(315.51916503906 ,826.84716796875 ,261.26873779297),
  127. CFrame.new(518.22473144531 ,826.24731445312 ,360.57772827148),
  128. CFrame.new(429.50021362305 ,875.04724121094 ,387.19262695312),
  129. CFrame.new(129.19146728516 ,826.84704589844 ,379.81701660156),
  130. CFrame.new(32.098743438721 ,828.24719238281 ,302.8957824707),
  131. CFrame.new(171.77783203125 ,826.84710693359 ,255.28721618652),
  132. CFrame.new(199.16697692871 ,857.84704589844 ,258.2873840332),
  133. CFrame.new(21.905725479126 ,870.04718017578 ,280.63858032227),
  134. CFrame.new(-74.956695556641 ,828.34704589844 ,386.41787719727),
  135. CFrame.new(-152.78285217285 ,830.97821044922 ,413.20315551758),
  136. CFrame.new(-99.575782775879 ,827.62579345703 ,429.30065917969),
  137. CFrame.new(-118.483543396 ,835.71136474609 ,402.61944580078),
  138. CFrame.new(-196.11956787109 ,826.84704589844 ,408.80563354492),
  139. CFrame.new(-192.16874694824 ,803.84710693359 ,458.53912353516),
  140. CFrame.new(-228.64126586914 ,826.84704589844 ,309.07147216797),
  141. CFrame.new(-334.5627746582 ,827.84716796875 ,382.34112548828),
  142. CFrame.new(-295.66107177734 ,827.7548828125 ,260.44488525390001),
  143. CFrame.new(-243.06549072266 ,826.84704589844 ,97.641380310059),
  144. CFrame.new(145.40446472168 ,827.79797363281 ,106.12605285645),
  145. CFrame.new(84.441474914551 ,826.84704589844 ,104.43872070312),
  146. CFrame.new(43.941471099854 ,826.84704589844 ,268.90521240234),
  147. CFrame.new(172.65376281738 ,826.84704589844 ,278.38635253906),
  148. CFrame.new(236.93182373047 ,826.84704589844 ,430.49688720703),
  149. CFrame.new(210.55850219727 ,803.84710693359 ,460.701171875),
  150. CFrame.new(448.04244995117 ,803.87713623047 ,438.78884887695),
  151. CFrame.new(126.77220153809 ,803.84710693359 ,560.0048828125),
  152. CFrame.new(-206.2195892334 ,890.84716796875 ,440.22219848633),
  153. CFrame.new(-470.92459106445 ,803.84710693359 ,381.17669677734),
  154. CFrame.new(-434.47100830078 ,803.84710693359 ,235.62271118164),
  155. CFrame.new(-442.24462890625 ,803.84710693359 ,-198.76741027832),
  156. CFrame.new(-101.06670379639 ,743.8486328125 ,8.9106760025024),
  157. CFrame.new(-355.35842895508 ,743.84289550781 ,204.35467529297),
  158. CFrame.new(-178.44441223145 ,720.17205810547 ,264.23211669922),
  159. CFrame.new(196.2378692627 ,671.93670654297 ,83.881690979004),
  160. CFrame.new(107.51532745361 ,749.04711914062 ,359.88635253906),
  161. CFrame.new(11.99014377594 ,744.07873535156 ,530.36346435547),
  162. CFrame.new(138.86274719238 ,743.84521484375 ,493.1076965332),
  163. CFrame.new(-38.685668945312 ,729.07989501953 ,365.58688354492),
  164. CFrame.new(13.609048843384 ,733.42077636719 ,267.63186645508),
  165. CFrame.new(-228.36434936523 ,751.04052734375 ,528.87542724609),
  166. CFrame.new(-426.47561645508 ,743.84716796875 ,460.21655273438),
  167. CFrame.new(-311.52005004883 ,722.84790039062 ,438.1628112793),
  168. CFrame.new(-475.11709594727 ,738.84729003906 ,212.75103759766)
  169. };
  170.  
  171. --Functions for grabbing items start here
  172. local function grabItem()
  173. for i,v in pairs(ws.Item_Spawns.Items:GetChildren()) do
  174. if v:IsA("Model") and v:FindFirstChildWhichIsA("MeshPart") or v:FindFirstChildWhichIsA("Part") and v:FindFirstChildWhichIsA("ClickDetector") then
  175. local mp = v:FindFirstChildWhichIsA("MeshPart") or v:FindFirstChildWhichIsA("Part");
  176. if (mp.Position - lp.Character.HumanoidRootPart.Position).magnitude <= 10 then
  177. print("Magnitude check passed");
  178. if mp.Transparency ~= 1 then
  179. print("Valid item check passed");
  180. _G.grabbingItem = true;
  181. lp.Character.HumanoidRootPart.CFrame = CFrame.new(mp.Position) * CFrame.new(0, 3, 0);
  182. wait(0.8);
  183. if v:FindFirstChildWhichIsA("ClickDetector") then
  184. fireclickdetector(v:FindFirstChildWhichIsA("ClickDetector"));
  185. for i = 1, 4 do wait()
  186. if (lp.PlayerGui:FindFirstChild("Message") and lp.PlayerGui.Message:FindFirstChild("TextLabel")) then
  187. if string.match(lp.PlayerGui.Message.TextLabel.Text, "You can't have more than") then
  188. v:Destroy();
  189. end
  190. end
  191. end
  192. end
  193. wait(0.25);
  194. _G.grabbingItem = false;
  195. end
  196. end
  197. end
  198. end
  199. end
  200.  
  201. local function grabFoundItem(v)
  202. if v:IsA("Model") and v:FindFirstChildWhichIsA("MeshPart") or v:FindFirstChildWhichIsA("Part") and v:FindFirstChildWhichIsA("ClickDetector") then
  203. local mp = v:FindFirstChildWhichIsA("MeshPart") or v:FindFirstChildWhichIsA("Part");
  204. if mp.Transparency ~= 1 then
  205. print("Valid item check passed(found item)");
  206. _G.grabbingItem = true;
  207. lp.Character.HumanoidRootPart.CFrame = CFrame.new(mp.Position) * CFrame.new(0, 3, 0);
  208. wait(0.8);
  209. if v:FindFirstChildWhichIsA("ClickDetector") then
  210. fireclickdetector(v:FindFirstChildWhichIsA("ClickDetector"));
  211. for i = 1, 4 do wait()
  212. if (lp.PlayerGui:FindFirstChild("Message") and lp.PlayerGui.Message:FindFirstChild("TextLabel")) then
  213. if string.match(lp.PlayerGui.Message.TextLabel.Text, "You can't have more than") then
  214. v:Destroy();
  215. end
  216. end
  217. end
  218. end
  219. wait(0.25);
  220. _G.grabbingItem = false;
  221. end
  222. end
  223. end
  224. --Functions for grabbing items end here
  225.  
  226. --Item autofarm starts here
  227. coroutine.wrap(function()
  228. while wait() do
  229. if _G.itemFarm and #(ws.Item_Spawns.Items:GetChildren()) >= 1 then
  230. if _G.grabbingItem then repeat wait() until not _G.grabbingItem; end
  231. _G.foundItem = true;
  232. for i,v in pairs(ws.Item_Spawns.Items:GetChildren()) do
  233. if (lp.Character and lp.Character:FindFirstChild("HumanoidRootPart")) then
  234. grabFoundItem(v);
  235. wait(0.8);
  236. _G.foundItem = false;
  237. end
  238. end
  239. end
  240. end
  241. end)();
  242.  
  243. while wait() do
  244. if _G.itemFarm then
  245. for i,v in ipairs(itemSpawns) do
  246. if _G.foundItem then repeat wait() until not _G.foundItem; end
  247. if _G.grabbingItem then repeat wait() until not _G.grabbingItem; end
  248. if (lp.Character and lp.Character:FindFirstChild("HumanoidRootPart")) then
  249. lp.Character.HumanoidRootPart.CFrame = v;
  250. wait(0.8);
  251. grabItem();
  252. wait(0.8);
  253. end
  254. end
  255. end
  256. end
  257.  
  258.  
  259. --Item autofarm ends here
  260. end
  261.  
  262.  
  263.  
  264.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement