Advertisement
FreshGamer430

Neighborhood Tycoon

Feb 11th, 2025
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.07 KB | Source Code | 0 0
  1. local autoCollectActive = false
  2.  
  3. local function createNeighborhoodGUI()
  4.     if game:GetService("Players").LocalPlayer:FindFirstChild("PlayerGui"):FindFirstChild("NeighborhoodGUI") then
  5.         return
  6.     end
  7.  
  8.     local ScreenGui = Instance.new("ScreenGui")
  9.     ScreenGui.Name = "NeighborhoodGUI"
  10.     ScreenGui.ResetOnSpawn = false
  11.     ScreenGui.Parent = game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui")
  12.  
  13.     local MainFrame = Instance.new("Frame")
  14.     MainFrame.Name = "MainFrame"
  15.     MainFrame.Size = UDim2.new(0.3, 0, 0.2, 0)
  16.     MainFrame.Position = UDim2.new(0.35, 0, 0.4, 0)
  17.     MainFrame.BackgroundColor3 = Color3.fromRGB(34, 139, 34)
  18.     MainFrame.Parent = ScreenGui
  19.  
  20.     local UICorner = Instance.new("UICorner")
  21.     UICorner.CornerRadius = UDim.new(0, 10)
  22.     UICorner.Parent = MainFrame
  23.  
  24.     local Title = Instance.new("TextLabel")
  25.     Title.Name = "Title"
  26.     Title.Size = UDim2.new(1, 0, 0.3, 0)
  27.     Title.Position = UDim2.new(0, 0, 0, 0)
  28.     Title.BackgroundTransparency = 1
  29.     Title.Text = "💚 Neighborhood Tycoon GUI 💚"
  30.     Title.Font = Enum.Font.FredokaOne
  31.     Title.TextSize = 24
  32.     Title.TextColor3 = Color3.fromRGB(255, 255, 255)
  33.     Title.Parent = MainFrame
  34.  
  35.     local AutoCollectButton = Instance.new("TextButton")
  36.     AutoCollectButton.Name = "AutoCollectButton"
  37.     AutoCollectButton.Size = UDim2.new(0.9, 0, 0.4, 0)
  38.     AutoCollectButton.Position = UDim2.new(0.05, 0, 0.4, 0)
  39.     AutoCollectButton.Text = "Auto Collect Money"
  40.     AutoCollectButton.Font = Enum.Font.FredokaOne
  41.     AutoCollectButton.TextSize = 18
  42.     AutoCollectButton.BackgroundColor3 = Color3.fromRGB(46, 204, 113)
  43.     AutoCollectButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  44.     AutoCollectButton.Parent = MainFrame
  45.  
  46.     local function startAutoCollect()
  47.         autoCollectActive = not autoCollectActive
  48.         AutoCollectButton.Text = autoCollectActive and "Stop Collecting" or "Auto Collect Money"
  49.  
  50.         while autoCollectActive do
  51.             local tycoonNumber = game:GetService("Players").LocalPlayer.TycoonNumber.Value
  52.             local mailbox = workspace.Tycoons[tostring(tycoonNumber)].StarterProps.Mailbox.Hitpart
  53.             firetouchinterest(mailbox, game:GetService("Players").LocalPlayer.Character.HumanoidRootPart, 0)
  54.             firetouchinterest(mailbox, game:GetService("Players").LocalPlayer.Character.HumanoidRootPart, 1)
  55.             wait(0.5)
  56.         end
  57.     end
  58.  
  59.     AutoCollectButton.MouseButton1Click:Connect(startAutoCollect)
  60.  
  61.     local function makeDraggable(frame)
  62.         local dragging = false
  63.         local dragInput, dragStart, startPos
  64.  
  65.         local function update(input)
  66.             local delta = input.Position - dragStart
  67.             frame.Position = UDim2.new(
  68.                 startPos.X.Scale,
  69.                 startPos.X.Offset + delta.X,
  70.                 startPos.Y.Scale,
  71.                 startPos.Y.Offset + delta.Y
  72.             )
  73.         end
  74.  
  75.         frame.InputBegan:Connect(function(input)
  76.             if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  77.                 dragging = true
  78.                 dragStart = input.Position
  79.                 startPos = frame.Position
  80.  
  81.                 input.Changed:Connect(function()
  82.                     if input.UserInputState == Enum.UserInputState.End then
  83.                         dragging = false
  84.                     end
  85.                 end)
  86.             end
  87.         end)
  88.  
  89.         frame.InputChanged:Connect(function(input)
  90.             if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
  91.                 dragInput = input
  92.             end
  93.         end)
  94.  
  95.         game:GetService("UserInputService").InputChanged:Connect(function(input)
  96.             if input == dragInput and dragging then
  97.                 update(input)
  98.             end
  99.         end)
  100.     end
  101.  
  102.     makeDraggable(MainFrame)
  103. end
  104.  
  105. createNeighborhoodGUI()
  106.  
  107. game:GetService("Players").LocalPlayer.CharacterAdded:Connect(function()
  108.     wait(1)
  109.     createNeighborhoodGUI()
  110. end)
  111.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement