Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local plr = game.Players.LocalPlayer;
- local rs = game:GetService("RunService")
- local uis = game:GetService("UserInputService")
- local heartbeatRate = 0.5;
- local function safeCall(func, ...)
- local s, e = pcall(func, ...)
- return s
- end;
- local function findDescendantIgnoreCase(parent, name)
- name = string.lower(name)
- for _, obj in pairs(parent:GetDescendants()) do
- if string.lower(obj.Name) == name then
- return obj
- end
- end;
- return nil
- end;
- local function hasStealPrompt(parent)
- for _, obj in pairs(parent:GetDescendants()) do
- if obj:IsA("ProximityPrompt") and string.lower(obj.Name) == "steal" then
- return obj
- end
- end;
- return nil
- end;
- local function fireStealPrompt(prompt)
- safeCall(function()
- fireproximityprompt(prompt)
- end)
- end;
- local ScreenGui = Instance.new("ScreenGui", game.CoreGui)
- ScreenGui.Name = ""
- local MainFrame = Instance.new("Frame", ScreenGui)
- MainFrame.Size = UDim2.new(0, 320, 0, 400)
- MainFrame.Position = UDim2.new(0, 50, 0, 50)
- MainFrame.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
- MainFrame.BorderSizePixel = 0;
- local Scroll = Instance.new("ScrollingFrame", MainFrame)
- Scroll.Size = UDim2.new(1, -10, 1, -10)
- Scroll.Position = UDim2.new(0, 5, 0, 5)
- Scroll.BackgroundTransparency = 1;
- Scroll.ScrollBarThickness = 8;
- local UIList = Instance.new("UIListLayout", Scroll)
- UIList.Padding = UDim.new(0, 5)
- UIList.SortOrder = Enum.SortOrder.LayoutOrder;
- UIList.HorizontalAlignment = Enum.HorizontalAlignment.Center;
- UIList.VerticalAlignment = Enum.VerticalAlignment.Top;
- local brainrotFrames = {}
- local lastUpdate = 0;
- local dragging = false;
- local dragInput, dragStart, startPos;
- local function updatePosition(input)
- local delta = input.Position - dragStart;
- MainFrame.Position = UDim2.new(0, startPos.X.Offset + delta.X, 0, startPos.Y.Offset + delta.Y)
- end;
- safeCall(function()
- MainFrame.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
- dragging = true;
- dragStart = input.Position;
- startPos = MainFrame.Position;
- input.Changed:Connect(function()
- if input.UserInputState == Enum.UserInputState.End then
- dragging = false
- end
- end)
- end
- end)
- MainFrame.InputChanged:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
- dragInput = input
- end
- end)
- uis.InputChanged:Connect(function(input)
- if input == dragInput and dragging then
- updatePosition(input)
- end
- end)
- end)
- local function updateBrainrots()
- safeCall(function()
- if not workspace:FindFirstChild("Brainrots") then
- return
- end;
- for br, btn in pairs(brainrotFrames) do
- if not br or not br.Parent then
- btn:Destroy()
- brainrotFrames[br] = nil
- end
- end;
- local totalHeight = 0;
- for _, candidate in pairs(workspace.Brainrots:GetDescendants()) do
- if candidate:IsA("Model") then
- local infoGui = findDescendantIgnoreCase(candidate, "infogui")
- local frame = infoGui and findDescendantIgnoreCase(infoGui, "frame")
- local charCash = frame and findDescendantIgnoreCase(frame, "charcash")
- local cashText = charCash and charCash.Text;
- local stealPrompt = hasStealPrompt(candidate)
- if cashText and stealPrompt then
- if not brainrotFrames[candidate] then
- local btn = Instance.new("TextButton", Scroll)
- btn.Size = UDim2.new(1, -10, 0, 50)
- btn.Text = cashText;
- btn.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
- btn.BorderSizePixel = 0;
- btn.TextScaled = true;
- btn.MouseButton1Click:Connect(function()
- safeCall(function()
- if plr.Character and plr.Character:FindFirstChild("HumanoidRootPart") then
- local targetPart = stealPrompt.Parent;
- if targetPart and targetPart:IsA("BasePart") then
- plr.Character.HumanoidRootPart.CFrame = targetPart.CFrame
- task.wait(0.3)
- fireStealPrompt(stealPrompt)
- task.delay(1.5, function()
- game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = workspace.Bases[game.Players.LocalPlayer:GetAttribute("Base")].Container.Spawn.CFrame
- end)
- end
- end
- end)
- end)
- brainrotFrames[candidate] = btn
- else
- brainrotFrames[candidate].Text = cashText
- end;
- totalHeight = totalHeight + 55
- end
- end
- end;
- Scroll.CanvasSize = UDim2.new(0, 0, 0, totalHeight)
- end)
- end;
- rs.RenderStepped:Connect(function()
- if tick() - lastUpdate >= heartbeatRate then
- lastUpdate = tick()
- updateBrainrots()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment