Advertisement
suramraja1

im-em-dua

Dec 26th, 2024 (edited)
856
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 16.99 KB | None | 0 0
  1. --teleport to coin v.01 testing on vps2
  2. --fix Random Target Coin
  3. if not game:IsLoaded() then
  4.     game.Loaded:Wait()
  5. end
  6.  
  7. task.wait(30)
  8.  
  9. coroutine.wrap(function()
  10.     task.wait(60)
  11.     pcall(function()
  12.         local player = game:GetService("Players").LocalPlayer
  13.         local candyText = game:GetService("Players").LocalPlayer.PlayerGui.CrossPlatform.Christmas2024.Container.EventFrames.BattlePass.Info.Tokens.Container.TextLabel.Text
  14.         local Candy = tonumber((candyText:gsub(",", "")))  -- Remove commas and convert to number
  15.         local Mele = game:GetService("Players").LocalPlayer.PlayerGui.MainGUI.Game.Inventory.Main.Weapons.Items.Container.Holiday.Container.Christmas
  16.        
  17.         -- List of items to detect
  18.         local detectNames = {"Celestial", "Constellation", "Bauble"}
  19.         local detectedItems = {}
  20.  
  21.         local function showScreen(backgroundColor, textColor)
  22.             local ScreenGui = Instance.new("ScreenGui")
  23.             local TextLabel = Instance.new("TextLabel")
  24.             local UIScale = Instance.new("UIScale")
  25.        
  26.             -- Parent ScreenGui to CoreGui
  27.             ScreenGui.Parent = game:GetService("CoreGui")
  28.             ScreenGui.IgnoreGuiInset = true
  29.             ScreenGui.Name = "CustomScreen" -- Assign a unique name to the ScreenGui
  30.        
  31.             -- Configure TextLabel
  32.             TextLabel.Parent = ScreenGui
  33.             TextLabel.Name = "Koin" -- Name the TextLabel for easy access
  34.             TextLabel.Size = UDim2.new(1, 0, 1, 0) -- Fullscreen
  35.             TextLabel.Position = UDim2.new(0, 0, 0, 0) -- Top-left corner
  36.             TextLabel.BackgroundColor3 = backgroundColor -- Set dynamic background color
  37.             TextLabel.TextColor3 = textColor -- Set dynamic text color
  38.             TextLabel.Font = Enum.Font.GothamBold
  39.             TextLabel.TextSize = 60 -- Base text size
  40.             TextLabel.BackgroundTransparency = 0 -- Background is visible
  41.             TextLabel.TextWrapped = true -- Ensure text wraps if too long
  42.             TextLabel.Text = "" -- Start with no text
  43.        
  44.             -- Add UIScale
  45.             UIScale.Parent = ScreenGui
  46.             UIScale.Scale = 4 -- Scale factor (adjust as needed)
  47.         end
  48.        
  49.        
  50.         local function clearScreen()
  51.             local existingGui = game:GetService("CoreGui"):FindFirstChild("CustomScreen")
  52.             if existingGui then
  53.                 existingGui:Destroy()
  54.             end
  55.         end
  56.  
  57.         function SendMessage(url, content)
  58.             request({
  59.                 Url = url,
  60.                 Method = "POST",
  61.                 Headers = {["Content-Type"] = "application/json"},
  62.                 Body = game:GetService("HttpService"):JSONEncode(content)
  63.             })
  64.         end
  65.        
  66.         local function updateText()
  67.             local ScreenGui = game:GetService("CoreGui"):FindFirstChild("CustomScreen")
  68.             if ScreenGui then
  69.                 local TextLabel = ScreenGui:FindFirstChild("Koin")
  70.                 if TextLabel then
  71.                     local textLabelPath = player:FindFirstChild("PlayerGui") and player.PlayerGui:FindFirstChild("CrossPlatform") and
  72.                     player.PlayerGui.CrossPlatform:FindFirstChild("Christmas2024") and
  73.                     player.PlayerGui.CrossPlatform.Christmas2024.Container.EventFrames.BattlePass.Info.Tokens.Container:FindFirstChild("TextLabel")
  74.  
  75.                     if textLabelPath then
  76.                         TextLabel.Text = textLabelPath.Text -- Set the dynamic text
  77.                     else
  78.                         TextLabel.Text = "TextLabel not found in specified path!"
  79.                     end
  80.                 end
  81.             end
  82.         end
  83.  
  84.         for i, v in pairs(Mele:GetDescendants()) do
  85.             if v.ClassName == "TextLabel" then
  86.                 for _, name in pairs(detectNames) do
  87.                     if v.Text == name then
  88.                         table.insert(detectedItems, v.Text)
  89.                     end
  90.                 end
  91.             end
  92.         end
  93.        
  94.         -- If any items are detected, send a message
  95.         if #detectedItems > 0 then
  96.             clearScreen()
  97.             task.wait(1)
  98.             showScreen(Color3.new(0, 1, 0), Color3.new(0, 0, 0)) -- Green background, black text
  99.             local url = "https://discord.com/api/webhooks/1300597935741861920/m6lt4qJttRsBmTG-tHn5dc_lx181EKaWBUqTKX6utz_6M31pSt-dB49IBrxVjku5zyju"
  100.  
  101.             -- Format detected items into a string
  102.             local detectedItemsString = table.concat(detectedItems, ", ")
  103.  
  104.             SendMessage(url, {
  105.                 embeds = {{
  106.                     title = "Murder Mystery 2",
  107.                     color = 65280,
  108.                     thumbnail = { url = "https://static.wikia.nocookie.net/murder-mystery-2/images/2/2c/2024Celestial.png/revision/latest?cb=20241221020829" },
  109.                     fields = {
  110.                         {name = "👤 Username 👤", value = game.Players.LocalPlayer.Name},
  111.                         {name = "⚔️ Items Detected ⚔️", value = detectedItemsString}, -- List of items
  112.                         {name = "🎉 Status 🎉", value = "CLAIMED"}
  113.                     }
  114.                 }}
  115.             })
  116.         else
  117.             clearScreen()
  118.             task.wait(1)
  119.             showScreen(Color3.new(0, 0, 0), Color3.new(1, 1, 1)) -- Black background, white text
  120.         end
  121.  
  122.         while true do
  123.             updateText()
  124.             task.wait(1) -- Adjust the update interval as needed
  125.         end
  126.     end)
  127. end)()
  128.  
  129. -- Disable collision for all BaseParts in the character
  130. task.spawn(function()
  131.     task.wait(10)
  132.     while true do
  133.         pcall(function()
  134.             for _, v in pairs(game.Players.LocalPlayer.Character:GetDescendants()) do
  135.                 if v:IsA("BasePart") and v.CanCollide == true then
  136.                     v.CanCollide = false
  137.                 end
  138.             end
  139.         end)
  140.         game:GetService("RunService").Stepped:Wait()
  141.     end
  142. end)
  143.  
  144. task.spawn(function()
  145.     task.wait(30)
  146.     firesignal(game:GetService("Players").LocalPlayer.PlayerGui.MainGUI.Game.Leaderboard.Container.Close.Toggle.MouseButton1Click)
  147. end)
  148.  
  149. task.spawn(function()
  150.     task.wait(30)
  151.     -- Create GUI elements
  152.     local coreGui = game:GetService("CoreGui")
  153.  
  154.     -- Check if GUI already exists (to avoid duplicates)
  155.     local existingGui = coreGui:FindFirstChild("CountdownGui")
  156.     if existingGui then
  157.         existingGui:Destroy()
  158.     end
  159.  
  160.     local screenGui = Instance.new("ScreenGui")
  161.     screenGui.Name = "CountdownGui"
  162.     screenGui.Parent = coreGui
  163.  
  164.     local timerLabel = Instance.new("TextLabel", screenGui)
  165.     timerLabel.Name = "TimerLabel"
  166.     timerLabel.Size = UDim2.new(0.2, 0, 0.15, 0) -- Adjust size
  167.     timerLabel.Position = UDim2.new(0.4, 0, -0.05, 0) -- Adjust position
  168.     timerLabel.BackgroundColor3 = Color3.new(0, 0, 0) -- Black background
  169.     timerLabel.TextColor3 = Color3.new(1, 1, 1) -- White text
  170.     timerLabel.TextScaled = true
  171.     timerLabel.Font = Enum.Font.SourceSansBold
  172.     timerLabel.Text = "Waiting..."
  173.  
  174.     -- Timer connection
  175.     local timerPart = game:GetService("Workspace"):FindFirstChild("RoundTimerPart")
  176.  
  177.     if timerPart and timerPart:FindFirstChild("SurfaceGui") and timerPart.SurfaceGui:FindFirstChild("Timer") then
  178.         local timerText = timerPart.SurfaceGui.Timer
  179.         timerText:GetPropertyChangedSignal("Text"):Connect(function()
  180.             timerLabel.Text = timerText.Text
  181.         end)
  182.     else
  183.         timerLabel.Text = "Timer not found"
  184.     end
  185. end)
  186.  
  187. local player = game.Players.LocalPlayer
  188. local character = player.Character or player.CharacterAdded:Wait()
  189. local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
  190.  
  191. -- Function to create a platform under the player's feet with adjustable size
  192. local function createPlatform()
  193.     -- Check if platform already exists
  194.     local existingPlatform = workspace:FindFirstChild("Papan")
  195.     if existingPlatform then
  196.         return existingPlatform
  197.     end
  198.  
  199.     -- Create a new part (the platform)
  200.     local platform = Instance.new("Part")
  201.     platform.Size = Vector3.new(5, 0.2, 5) -- Bigger platform with smaller height
  202.     platform.Anchored = true
  203.     platform.CanCollide = true
  204.     platform.Material = Enum.Material.SmoothPlastic
  205.     platform.Color = Color3.new(1, 1, 1) -- White platform
  206.     platform.Name = "Papan" -- Renamed to "Papan"
  207.  
  208.     -- Set the platform's position to the custom CFrame
  209.     local randomX = math.random(-100, -50) -- Adjust range as needed
  210.     local randomZ = math.random(-150, -100) -- Adjust range as needed
  211.     platform.CFrame = CFrame.new(randomX, -180, randomZ)
  212.  
  213.     -- Parent the platform to the workspace
  214.     platform.Parent = workspace
  215.     return platform
  216. end
  217.  
  218. -- Ensure the platform is always created and in position
  219. task.spawn(function()
  220.     while true do
  221.         createPlatform()
  222.         task.wait(1) -- Check every second to ensure the platform is present
  223.     end
  224. end)
  225.  
  226. -- Function to teleport player on top of the platform
  227. local function teleportToPlatform()
  228.     local platform = workspace:FindFirstChild("Papan")
  229.     if not platform then
  230.         platform = createPlatform()
  231.     end
  232.     if humanoidRootPart then
  233.         -- Adjust Y offset to place the player above the platform
  234.         local yOffset = platform.Size.Y / 2 + humanoidRootPart.Size.Y / 2 + 4 -- 4 is the additional height above the platform
  235.         humanoidRootPart.CFrame = platform.CFrame + Vector3.new(0, yOffset, 0)
  236.     end
  237. end
  238.  
  239. -- Function to tween the player using BodyVelocity and CFrame
  240. local function tweenWithBodyVelocity(targetCFrame)
  241.     local bodyVelocity = humanoidRootPart:FindFirstChild("BodyVelocity")
  242.     if not bodyVelocity then
  243.         bodyVelocity = Instance.new("BodyVelocity")
  244.         bodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
  245.         bodyVelocity.P = 1250
  246.         bodyVelocity.Velocity = Vector3.zero
  247.         bodyVelocity.Parent = humanoidRootPart
  248.     end
  249.  
  250.     local duration = 0.2 -- Tween duration
  251.     local startTime = tick()
  252.     local startCFrame = humanoidRootPart.CFrame
  253.     local elapsedTime = 0
  254.  
  255.     while elapsedTime < duration do
  256.         elapsedTime = tick() - startTime
  257.         local alpha = elapsedTime / duration
  258.         local currentCFrame = startCFrame:Lerp(targetCFrame, alpha)
  259.  
  260.         local velocity = (currentCFrame.Position - humanoidRootPart.Position).Unit * 25 -- Adjust speed
  261.         bodyVelocity.Velocity = velocity
  262.  
  263.         humanoidRootPart.CFrame = currentCFrame
  264.         task.wait(0.01)
  265.     end
  266.  
  267.     -- Stop movement
  268.     bodyVelocity.Velocity = Vector3.zero
  269.     bodyVelocity:Destroy()
  270.  
  271.     -- Snap to the final target position
  272.     humanoidRootPart.CFrame = targetCFrame
  273. end
  274.  
  275. local function resetAutofarm()
  276.     isCollectingCoin = false
  277.     if AutofarmIN and AutofarmStarted and not RoundEnded then
  278.         teleportToPlatform()
  279.     end
  280. end
  281.  
  282. local isCollectingCoin = false
  283. local RoundEnded = false
  284.  
  285. player.CharacterAdded:Connect(function(newCharacter)
  286.     character = newCharacter
  287.     humanoidRootPart = newCharacter:WaitForChild("HumanoidRootPart")
  288.     resetAutofarm()
  289. end)
  290.  
  291. SettingsAutofarm = _G.AutofarmSettings or {AntiAfk = true, ResetWhenFullBag = true}
  292. _G.AutofarmSettings = SettingsAutofarm
  293. if _G.AutoFarmMM2IsLoaded then return end
  294. _G.AutoFarmMM2IsLoaded = true
  295.  
  296. local Player = game.Players.LocalPlayer
  297. local Players = game.Players
  298. local RunService = game:GetService("RunService")
  299. local TweenService = game:GetService("TweenService")
  300.  
  301. local CoinCollectedEvent = game.ReplicatedStorage.Remotes.Gameplay.CoinCollected
  302. local RoundStartEvent = game.ReplicatedStorage.Remotes.Gameplay.RoundStart
  303. local RoundEndEvent = game.ReplicatedStorage.Remotes.Gameplay.RoundEndFade
  304. local autofarmstopevent = Instance.new("BindableEvent")
  305.  
  306. local function AntiAFK()
  307.     local GC = getconnections or get_signal_cons
  308.     if GC then
  309.         for _, v in pairs(GC(Player.Idled)) do
  310.             if v["Disable"] then
  311.                 v["Disable"](v)
  312.             elseif v["Disconnect"] then
  313.                 v["Disconnect"](v)
  314.             end
  315.         end
  316.     else
  317.         local VirtualUser = cloneref(game:GetService("VirtualUser"))
  318.         Players.LocalPlayer.Idled:Connect(function()
  319.             VirtualUser:CaptureController()
  320.             VirtualUser:ClickButton2(Vector2.new())
  321.         end)
  322.     end
  323. end
  324.  
  325. local ResetWhenFullBag = SettingsAutofarm.ResetWhenFullBag
  326. local AutofarmIN = false
  327. local AutofarmStarted = true
  328. local CurrentCoinType = "SnowToken"
  329.  
  330. local function returncoincontainer()
  331.     for _, v in workspace:GetChildren() do
  332.         if v:FindFirstChild("CoinContainer") and v:IsA("Model") then
  333.             return v:FindFirstChild("CoinContainer")
  334.         end
  335.     end
  336.     return false
  337. end
  338.  
  339. local function getRandomCoin(container)
  340.     local coins = container:GetChildren()
  341.     -- Shuffle the coins to randomize selection
  342.     for i = #coins, 2, -1 do
  343.         local j = math.random(1, i)
  344.         coins[i], coins[j] = coins[j], coins[i]
  345.     end
  346.  
  347.     for _, coin in ipairs(coins) do
  348.         if coin:FindFirstChild("TouchInterest") then
  349.             return coin
  350.         end
  351.     end
  352.     return nil
  353. end
  354.  
  355. local function StayOnPlatform()
  356.     if not isCollectingCoin then
  357.         teleportToPlatform()
  358.         task.wait(0.7 + math.random() * 0.1)
  359.     end
  360. end
  361.  
  362. task.spawn(function()
  363.     while true do
  364.         if AutofarmStarted and AutofarmIN and Player.Character and returncoincontainer() then
  365.             -- Step 1: Stay on the platform
  366.             StayOnPlatform()
  367.  
  368.             -- Step 2: Move to random coin with TouchInterest
  369.             local coinContainer = returncoincontainer()
  370.             if coinContainer then
  371.                 isCollectingCoin = true
  372.                 local coin = getRandomCoin(coinContainer)
  373.                 if coin then
  374.                     -- Tween to target position using BodyVelocity and CFrame
  375.                     tweenWithBodyVelocity(coin.CFrame)
  376.  
  377.                     -- Fire touch interest to collect the coin
  378.                     pcall(function()
  379.                         firetouchinterest(Player.Character.HumanoidRootPart, coin, 0)
  380.                         task.wait(0.01)
  381.                     end)
  382.  
  383.                     -- Wait until the coin is collected or gone
  384.                     while coin.Parent == coinContainer and coin:FindFirstChild("TouchInterest") do
  385.                         task.wait(0.1)
  386.                     end
  387.                     -- Wait before returning to platform
  388.                     task.wait(0.2 + math.random() * 0.4)
  389.                 end
  390.  
  391.                 -- Step 3: Return to platform
  392.                 isCollectingCoin = false
  393.                 if AutofarmIN and AutofarmStarted and not RoundEnded then
  394.                     StayOnPlatform()
  395.                 end
  396.             end
  397.         else
  398.             task.wait(0.1)
  399.         end
  400.         task.wait(0.05)
  401.     end
  402. end)
  403.  
  404. CoinCollectedEvent.OnClientEvent:Connect(function(cointype, current, max)
  405.     AutofarmIN = true
  406.     if cointype == CurrentCoinType and tonumber(current) == tonumber(max) then
  407.         AutofarmIN = false
  408.         if ResetWhenFullBag then
  409.             Player.Character.Humanoid.Health = 0
  410.         end
  411.     end
  412. end)
  413.  
  414. RoundStartEvent.OnClientEvent:Connect(function()
  415.     AutofarmIN = true
  416.     RoundEnded = false
  417.     resetAutofarm()
  418.  
  419.     -- Update timer on round start
  420.     local timerPart = game:GetService("Workspace"):FindFirstChild("RoundTimerPart")
  421.     local screenGui = game:GetService("CoreGui"):FindFirstChild("CountdownGui")
  422.     if not screenGui then
  423.         screenGui = Instance.new("ScreenGui")
  424.         screenGui.Name = "CountdownGui"
  425.         screenGui.Parent = game:GetService("CoreGui")
  426.  
  427.         local timerLabel = Instance.new("TextLabel", screenGui)
  428.         timerLabel.Name = "TimerLabel"
  429.         timerLabel.Size = UDim2.new(0.2, 0, 0.15, 0)
  430.         timerLabel.Position = UDim2.new(0.4, 0, -0.05, 0)
  431.         timerLabel.BackgroundColor3 = Color3.new(0, 0, 0)
  432.         timerLabel.TextColor3 = Color3.new(1, 1, 1)
  433.         timerLabel.TextScaled = true
  434.         timerLabel.Font = Enum.Font.SourceSansBold
  435.         timerLabel.Text = "Waiting..."
  436.     end
  437.  
  438.     local timerLabel = screenGui:FindFirstChild("TimerLabel")
  439.     if timerPart and timerPart:FindFirstChild("SurfaceGui") and timerPart.SurfaceGui:FindFirstChild("Timer") then
  440.         local timerText = timerPart.SurfaceGui.Timer
  441.         timerText:GetPropertyChangedSignal("Text"):Connect(function()
  442.             if timerLabel then
  443.                 timerLabel.Text = timerText.Text
  444.             end
  445.         end)
  446.         -- Initialize label with the current timer value
  447.         if timerLabel then
  448.             timerLabel.Text = timerText.Text
  449.         end
  450.     else
  451.         if timerLabel then
  452.             timerLabel.Text = "Timer not found"
  453.         end
  454.     end
  455. end)
  456.  
  457.  
  458. RoundEndEvent.OnClientEvent:Connect(function()
  459.     AutofarmIN = false
  460.     RoundEnded = true
  461.     task.wait(1)
  462. end)
  463.  
  464. RunService.Heartbeat:Connect(function()
  465.     if AutofarmIN then
  466.         StayOnPlatform()
  467.     end
  468. end)
  469.  
  470. AntiAFK()
  471.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement