Advertisement
probanana

Mining Simulator 2 Christmas House farm

Dec 7th, 2022
442
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.94 KB | None | 0 0
  1. --Fortnitgamer696 made code
  2. --xdeformedbread put code into GUI
  3.  
  4. _G.Tog = false -- toggle make it false if u want to turn the autofarm off
  5. _G.Walk = false -- put this on true if u want it to walk instead of teleporting. It just makes it look legit
  6. _G.TweenSpeed = 40 -- lower = faster, higher = slower, DO not make this too low or u will get teleported back
  7.  
  8.  
  9. local Mercury = loadstring(game:HttpGet("https://raw.githubusercontent.com/deeeity/mercury-lib/master/src.lua"))()
  10.  
  11.  
  12.  
  13. local players = game:GetService("Players")
  14. local localPlayer = players.LocalPlayer
  15. local char = localPlayer.Character
  16.  
  17. function tp(bool, ...)
  18. local plr = game.Players.LocalPlayer
  19. local args = {...}
  20. if typeof(args[1]) == "number" and args[2] and args[3] then
  21. args = Vector3.new(args[1], args[2], args[3])
  22. elseif typeof(args[1]) == "Vector3" then
  23. args = args[1]
  24. elseif typeof(args[1]) == "CFrame" then
  25. args = args[1].Position
  26. end
  27. local dist = (plr.Character.HumanoidRootPart.Position - args).Magnitude
  28. local tween =
  29. game:GetService("TweenService"):Create(
  30. plr.Character.HumanoidRootPart,
  31. TweenInfo.new(dist / _G.TweenSpeed, Enum.EasingStyle.Linear),
  32. {CFrame = CFrame.new(args)}
  33. )
  34. if bool == false then
  35. tween:Play()
  36. tween.Completed:Wait()
  37. else
  38. game.Players.LocalPlayer.Character.Humanoid:MoveTo(args)
  39. game.Players.LocalPlayer.Character.Humanoid.MoveToFinished:Wait()
  40. end
  41. end
  42.  
  43. local Players = game:GetService("Players")
  44. local LocalPlayer = Players.LocalPlayer
  45.  
  46. local function GetClosest()
  47. local Character = LocalPlayer.Character
  48. local HumanoidRootPart = Character and Character:FindFirstChild("HumanoidRootPart")
  49. if not (Character or HumanoidRootPart) then
  50. return
  51. end
  52.  
  53. local TargetDistance = math.huge
  54. local Target
  55.  
  56. for i, v in ipairs(game:GetService("Workspace").Worlds["Christmas World"].Houses:GetChildren()) do
  57. if
  58. v:FindFirstChild("Activation") and v.Activation:FindFirstChild("Root") and
  59. v.Activation.Root.Decal.Transparency < 1 and
  60. v.Activation.Root.Decal.Color3 == Color3.fromRGB(0, 255, 255)
  61. then
  62. local TargetHRP = v.Activation.Root
  63. local mag = (HumanoidRootPart.Position - TargetHRP.Position).magnitude
  64. if mag < TargetDistance then
  65. TargetDistance = mag
  66. Target = v.Activation.Root
  67. end
  68. end
  69. end
  70.  
  71. return Target
  72. end
  73.  
  74.  
  75. function tpFarm()
  76. while _G.Tog == true do
  77. wait(.1)
  78. for i, v in pairs(game:GetService("Workspace").Worlds["Christmas World"].Houses:GetChildren()) do
  79. if _G.Tog == true and v:FindFirstChild("Activation") and v.Activation.Root.Decal.Transparency < 1 then
  80. repeat
  81. wait()
  82. tp(_G.Walk, GetClosest().Position)
  83. until v.Activation.Root.Decal.Transparency > 0 or _G.Tog == false
  84.  
  85. end
  86. end
  87. end
  88. end
  89.  
  90.  
  91.  
  92.  
  93.  
  94. local GUI = Mercury:Create{
  95. Name = "Mercury",
  96. Size = UDim2.fromOffset(600, 400),
  97. Theme = Mercury.Themes.Dark,
  98. Link = "https://github.com/deeeity/mercury-lib"
  99. }
  100.  
  101.  
  102. local Tab = GUI:Tab{
  103. Name = "Main",
  104. Icon = "rbxassetid://10471593579"
  105.  
  106. }
  107.  
  108. --tp farm
  109. Tab:Toggle{
  110. Name = "Farm Chirstmas Houses Teleport | BE CLOSE TO HOUSES!",
  111. StartingState = false,
  112. Description = "Will teleport you to the christmas houses.",
  113. Callback = function(bool)
  114. _G.Tog = bool
  115. if bool then
  116. tpFarm()
  117. end
  118. end
  119. }
  120.  
  121. --walk toggle farm
  122. Tab:Toggle{
  123. Name = "Chirstmas Houses Walking | BE CLOSE TO HOUSES!",
  124. StartingState = false,
  125. Description = "Walk to each christmas house making it look legit. ENABLE BEFORE TELEPORT!",
  126. Callback = function(bool)
  127. _G.Walk = bool
  128. print("Walk farm is", bool)
  129. end
  130. }
  131.  
  132. --adjust tp speed
  133. Tab:Slider{
  134. Name = "Adjust the teleport speed",
  135. Default = 40,
  136. Min = 0,
  137. Max = 40,
  138. Description = "Change Speed before starting. Higher = faster. | lower = slower.",
  139. Callback = function(value)
  140. _G.TweenSpeed = value
  141. print(value)
  142. end
  143. }
  144.  
  145. --tps to christmas world
  146. Tab:Button{
  147. Name = "Tp To Chirstmas World",
  148. Description = nil,
  149. Callback = function()
  150. local args = {[1] = "Christmas World"}game:GetService("ReplicatedStorage").Events.Teleport:FireServer(unpack(args))
  151. end
  152. }
  153.  
  154. --kills player
  155. Tab:Button{
  156. Name = "Stop Tween",
  157. Description = nil,
  158. Callback = function()
  159. game:GetService("Players").LocalPlayer.Character.Humanoid.Health = 0
  160. end
  161. }
  162.  
  163. --creds
  164. GUI:Credit{
  165. Name = "Put Code Into GUI",
  166. Description = "I did not make the code! I only put it into the GUI.",
  167. V3rm = "https://v3rmillion.net/member.php?action=profile&uid=2398060",
  168. Discord = "xdeformedbread#4207"
  169. }
  170.  
  171. GUI:Credit{
  172. Name = "Made The Code",
  173. Description = "This person made the code, credit to them!",
  174. V3rm = "https://v3rmillion.net/member.php?action=profile&uid=1436797",
  175. Discord = "Monke#4072"
  176. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement