SkyGutter-GMG

Hat Magnet Simulator

Jan 14th, 2022
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.59 KB | None | 0 0
  1. local library = loadstring(game:HttpGet(('https://raw.githubusercontent.com/Maxgat5/UiLib/main/lua')))()
  2. local w = library:CreateWindow("Hat Magnet Simulator")
  3. local b = w:CreateFolder("AutoFarm")
  4. local f = w:CreateFolder("AutoBuy")
  5. local e = w:CreateFolder("Mix")
  6. local u = w:CreateFolder("Credits")
  7. SelectedEgg = ""
  8. Eggs = {}
  9. for i,v in pairs(game:GetService("Workspace").Eggs:GetChildren()) do
  10. if not table.find(Eggs,v.Name) then
  11. table.insert(Eggs,v.Name)
  12. end
  13. end
  14. Ranges = {}
  15. for i,v in pairs(game:GetService("Players").LocalPlayer.PlayerGui.Main.IngameShopFrame.Main.RangesFrame:GetDescendants()) do
  16. if v.ClassName == "TextLabel" then
  17. if v.Name == "RangeName" then
  18. if not table.find(Ranges,v.Text) then
  19. table.insert(Ranges,v.Text)
  20. end
  21. end
  22. end
  23. end
  24. Ranks = {}
  25. for i,v in pairs(game:GetService("Players").LocalPlayer.PlayerGui.Main.IngameShopFrame.Main.RanksFrame:GetDescendants()) do
  26. if v.ClassName == "TextLabel" then
  27. if v.Name == "RangeName" then
  28. if not table.find(Ranks,v.Text) then
  29. table.insert(Ranks,v.Text)
  30. end
  31. end
  32. end
  33. end
  34. Upgrade = {}
  35. for i,v in pairs(game:GetService("Players").LocalPlayer.PlayerGui.Main.IngameShopFrame.Main.UpgradesFrame:GetDescendants()) do
  36. if v.ClassName == "TextLabel" then
  37. if v.Name == "RangeName" then
  38. if not table.find(Upgrade,v.Text) then
  39. table.insert(Upgrade,v.Text)
  40. end
  41. end
  42. end
  43. end
  44. Speed = 50
  45. SelectedArea = ""
  46. Area = {}
  47. for i,v in pairs(game:GetService("Workspace").SpawnedHats:GetChildren()) do
  48. if not table.find(Area,v.Name) then
  49. table.insert(Area,v.Name)
  50. end
  51. end
  52.  
  53. b:Dropdown("Select Area",Area,true,function(a)
  54. SelectedArea = a
  55. end)
  56.  
  57. b:Toggle("AutoTpHat v1",function(bool)
  58. shared.toggle = bool
  59. AutoTpHatv1 = bool
  60. end)
  61.  
  62. b:Toggle("AutoTpHat v2",function(bool)
  63. shared.toggle = bool
  64. AutoTpHatv2 = bool
  65. end)
  66.  
  67. b:Toggle("AutoSell",function(bool)
  68. shared.toggle = bool
  69. AutoSellv1 = bool
  70. end)
  71.  
  72. f:Dropdown("Select Egg",Eggs,true,function(a)
  73. SelectedEgg = a
  74. end)
  75.  
  76. f:Toggle("Egg",function(bool)
  77. shared.toggle = bool
  78. Egg = bool
  79. end)
  80.  
  81. f:Toggle("Ranges",function(bool)
  82. shared.toggle = bool
  83. Ranges1 = bool
  84. end)
  85.  
  86. f:Toggle("Ranks",function(bool)
  87. shared.toggle = bool
  88. Ranks1 = bool
  89. end)
  90.  
  91. f:Toggle("Upgrade",function(bool)
  92. shared.toggle = bool
  93. Upgrade1 = bool
  94. end)
  95.  
  96. f:Toggle("Rebirth",function(bool)
  97. shared.toggle = bool
  98. Rebirth = bool
  99. end)
  100.  
  101. f:Toggle("Sacrifice",function(bool)
  102. shared.toggle = bool
  103. Sacrifice = bool
  104. end)
  105.  
  106. e:Toggle("AntiAfk",function(bool)
  107. shared.toggle = bool
  108. AntiAfk = bool
  109. end)
  110.  
  111. e:Box("Speed Amount","number",function(value)
  112. Speed = value
  113. end)
  114.  
  115. e:Button("Speed",function()
  116. game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = Speed
  117. end)
  118.  
  119. e:Button("Open Shop",function()
  120. firetouchinterest(game.Players.LocalPlayer.Character.HumanoidRootPart, game:GetService("Workspace").TouchParts.Shop, 0)
  121. wait(.1)
  122. firetouchinterest(game.Players.LocalPlayer.Character.HumanoidRootPart, game:GetService("Workspace").TouchParts.Shop, 1)
  123. wait(.1)
  124. end)
  125. --Credits
  126. u:Label("Youtube Subs: "..getgenv().Subscribers,{
  127. TextSize = 25;
  128. TextColor = Color3.fromRGB(255,255,255);
  129. BgColor = Color3.fromRGB(69,69,69)
  130. })
  131.  
  132. u:Label("Discord Members: "..getgenv().TotalMembers,{
  133. TextSize = 25;
  134. TextColor = Color3.fromRGB(255,255,255);
  135. BgColor = Color3.fromRGB(69,69,69)
  136. })
  137.  
  138. u:Label("Pastebin Views: "..getgenv().TotalPastebinViews,{
  139. TextSize = 25;
  140. TextColor = Color3.fromRGB(255,255,255);
  141. BgColor = Color3.fromRGB(69,69,69)
  142. })
  143.  
  144. u:Button("Discord Server",function()
  145. setclipboard(getgenv().Discord)
  146. end)
  147.  
  148. u:Button("Youtube Channel",function()
  149. setclipboard(getgenv().Youtube)
  150. end)
  151.  
  152. u:Button("Pastebin Page",function()
  153. setclipboard(getgenv().Pastebin)
  154. end)
  155.  
  156. u:Button(getgenv().Username,function()
  157. setclipboard(getgenv().Username)
  158. end)
  159.  
  160. game:GetService('RunService').Stepped:connect(function()
  161. spawn(function()
  162. if AntiAfk == true then
  163. local bb=game:service'VirtualUser'
  164. bb:CaptureController()
  165. bb:ClickButton2(Vector2.new())
  166. end
  167. end)
  168. end)
  169.  
  170. spawn(function()
  171. while wait() do
  172. if AutoTpHatv1 == true then
  173. pcall(function()
  174. function ClosestPart()
  175. local dist = 50
  176. local target = nil
  177. for i,v in pairs(game:GetService("Workspace").SpawnedHats:GetChildren()) do
  178. if v.Name == SelectedArea then
  179. for i,v1 in pairs(v:GetChildren()) do
  180. if v1.ClassName == "Part" then
  181. if v1.Transparency ~= 1 then
  182. local magnitude = (v1.Position - game:GetService("Players").LocalPlayer.Character.Head.Position).magnitude
  183. if magnitude > dist then
  184. dist = magnitude
  185. target = v1
  186. end
  187. end
  188. end
  189. end
  190. end
  191. end
  192. return target
  193. end
  194. local tool = game.Players.LocalPlayer.Backpack:FindFirstChildOfClass("Tool") or game.Players.LocalPlayer.Character:FindFirstChildOfClass("Tool")
  195. game.Players.LocalPlayer.Character.Humanoid:EquipTool(tool)
  196. game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(ClosestPart().CFrame.Position + Vector3.new(0,0,0))
  197. end)
  198. end
  199. end
  200. end)
  201.  
  202. spawn(function()
  203. while wait() do
  204. if AutoTpHatv2 == true then
  205. pcall(function()
  206. function ClosestPart()
  207. local dist = math.huge
  208. local target = nil
  209. for i,v in pairs(game:GetService("Workspace").SpawnedHats:GetChildren()) do
  210. if v.Name == SelectedArea then
  211. for i,v1 in pairs(v:GetChildren()) do
  212. if v1.ClassName == "Part" then
  213. if v1.Transparency ~= 1 then
  214. local magnitude = (v1.Position - game:GetService("Players").LocalPlayer.Character.Head.Position).magnitude
  215. if magnitude < dist then
  216. dist = magnitude
  217. target = v1
  218. end
  219. end
  220. end
  221. end
  222. end
  223. end
  224. return target
  225. end
  226. local tool = game.Players.LocalPlayer.Backpack:FindFirstChildOfClass("Tool") or game.Players.LocalPlayer.Character:FindFirstChildOfClass("Tool")
  227. game.Players.LocalPlayer.Character.Humanoid:EquipTool(tool)
  228. game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(ClosestPart().CFrame.Position + Vector3.new(0,0,0))
  229. end)
  230. end
  231. end
  232. end)
  233.  
  234. spawn(function()
  235. while wait() do
  236. if AutoSellv1 == true then
  237. firetouchinterest(game.Players.LocalPlayer.Character.HumanoidRootPart, game:GetService("Workspace").TouchParts.Sell, 0)
  238. wait(.1)
  239. firetouchinterest(game.Players.LocalPlayer.Character.HumanoidRootPart, game:GetService("Workspace").TouchParts.Sell, 1)
  240. wait(.1)
  241. end
  242. end
  243. end)
  244.  
  245. spawn(function()
  246. while wait() do
  247. if Ranges1 == true then
  248. for i,v in pairs(Ranges) do
  249. game:GetService("ReplicatedStorage").GameClient.Events.RemoteFunctions.BuyRange:InvokeServer(tostring(v),"Range")
  250. end
  251. end
  252. end
  253. end)
  254.  
  255. spawn(function()
  256. while wait() do
  257. if Ranks1 == true then
  258. for i,v in pairs(Ranks) do
  259. game:GetService("ReplicatedStorage").GameClient.Events.RemoteFunctions.BuyRange:InvokeServer(tostring(v),"Rank")
  260. end
  261. end
  262. end
  263. end)
  264.  
  265. spawn(function()
  266. while wait() do
  267. if Upgrade1 == true then
  268. for i,v in pairs(Upgrade) do
  269. game:GetService("ReplicatedStorage").GameClient.Events.RemoteFunctions.BuyRange:InvokeServer(tostring(v),"Upgrade")
  270. end
  271. end
  272. end
  273. end)
  274.  
  275. spawn(function()
  276. while wait() do
  277. if Rebirth == true then
  278. game:GetService("ReplicatedStorage").GameClient.Events.RemoteFunctions.Rebirth:InvokeServer("Rebirth",1)
  279. end
  280. end
  281. end)
  282.  
  283. spawn(function()
  284. while wait() do
  285. if Sacrifice == true then
  286. game:GetService("ReplicatedStorage").GameClient.Events.RemoteFunctions.Rebirth:InvokeServer("Sacrifice")
  287. end
  288. end
  289. end)
  290.  
  291. spawn(function()
  292. while wait() do
  293. if Egg == true then
  294. game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(game:GetService("Workspace").Eggs[SelectedEgg].EggModel.Egg.CFrame.Position + Vector3.new(0,0,0))
  295. game:GetService("ReplicatedStorage").GameClient.Events.RemoteFunctions.EggOpened:InvokeServer(tostring(SelectedEgg),"Single")
  296. end
  297. end
  298. end)
Advertisement
Add Comment
Please, Sign In to add comment