Shoujo_Ingrid

MM2 autofarm script

Dec 23rd, 2024
906
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.38 KB | None | 0 0
  1. loadstring(game:HttpGet("https://raw.githubusercontent.com/KazeOnTop/Rice-Anti-Afk/main/Wind", true))()
  2.  
  3. local ts = game:GetService("TweenService")
  4.  
  5. local tweenSpeed = 0
  6.  
  7. local bestDistance = 999999999999999
  8.  
  9. local playerCoins = game.Players.LocalPlayer.PlayerGui.CrossPlatform.Christmas2024.Container.EventFrames.MysteryBox.Info.Tokens.Container.TextLabel.Text
  10.  
  11. local bestCoinLocation = nil
  12.  
  13. local function canCollide(character, command)
  14. for i, v in character:GetDescendants() do
  15. if v:IsA("BasePart") and command == "on" then
  16. v.CanCollide = true
  17. elseif v:IsA("BasePart") and command == "off" then
  18. v.CanCollide = false
  19. end
  20. end
  21. end
  22.  
  23. local function findNearestCoin ()
  24. local player = game.Players.LocalPlayer
  25. for i, v in game.Workspace:GetDescendants() do
  26. if v.Name == "CoinContainer" and v:IsA("Model") then
  27. for i, coin in v:GetChildren() do
  28. if coin:FindFirstChild("TouchInterest") and player.character then
  29. local character = game.Players.LocalPlayer.Character
  30. local hrp = character.HumanoidRootPart
  31. local coinLocation = coin.CFrame.Position
  32.  
  33. local distance = (hrp.CFrame.Position - coinLocation).magnitude
  34.  
  35. if distance < bestDistance then
  36. bestDistance = distance
  37. bestCoinLocation = coinLocation
  38. end
  39. end
  40. end
  41. end
  42. end
  43. end
  44.  
  45. while true do
  46. pcall(function()
  47. task.wait()
  48. local player = game.Players.LocalPlayer
  49. bestDistance = 999999999999999
  50.  
  51. bestCoinLocation = nil
  52.  
  53. findNearestCoin()
  54.  
  55. tweenSpeed = bestDistance/25
  56.  
  57. if tweenSpeed >= 10 then
  58. for i, v in game:GetDescendants() do
  59. if v.Name == "CoinContainer" and v:IsA("Model") then
  60. local randomCoin = v:FindFirstChild("Coin_Server")
  61. local randomCoinPos = randomCoin.CFrame.Position
  62. player.Character:PivotTo(CFrame.new(randomCoinPos))
  63. findNearestCoin()
  64. tweenSpeed = bestDistance/25
  65. end
  66. end
  67. end
  68.  
  69. local tweenInfo = TweenInfo.new(tweenSpeed, Enum.EasingStyle.Linear)
  70. local goal = {
  71. CFrame = CFrame.new(bestCoinLocation)
  72. }
  73. local tween = ts:Create(player.Character.HumanoidRootPart, tweenInfo, goal)
  74. tween:Play()
  75. canCollide(player.character, "off")
  76. tween.Completed:Wait()
  77. canCollide(player.character, "on")
  78.  
  79. if player.Character and player.PlayerGui.MainGUI.Game.CoinBags.Container.SnowToken.Full.Visible then
  80. player.Character.Humanoid.Health = 0
  81. end
  82. end)
  83. end
Advertisement
Add Comment
Please, Sign In to add comment