local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local player = Players.LocalPlayer
local pGui = player:WaitForChild("PlayerGui")
if pGui:FindFirstChild("TycoonFriendlyUI") then pGui.TycoonFriendlyUI:Destroy() end
local sg = Instance.new("ScreenGui", pGui)
sg.Name = "TycoonFriendlyUI"
sg.ResetOnSpawn = false
local frame = Instance.new("Frame", sg)
frame.Size = UDim2.new(0, 260, 0, 360)
frame.Position = UDim2.new(0.5, -130, 0.2, 0)
frame.BackgroundColor3 = Color3.fromRGB(12, 12, 12)
frame.BorderSizePixel = 0
Instance.new("UICorner", frame).CornerRadius = UDim.new(0, 10)
local dragBar = Instance.new("Frame", frame)
dragBar.Size = UDim2.new(1, 0, 0, 30)
dragBar.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
dragBar.BorderSizePixel = 0
Instance.new("UICorner", dragBar).CornerRadius = UDim.new(0, 10)
local title = Instance.new("TextLabel", dragBar)
title.Size = UDim2.new(1, 0, 1, 0)
title.BackgroundTransparency = 1
title.Text = "TYCOON UTILITY"
title.TextColor3 = Color3.new(1, 1, 1)
title.Font = Enum.Font.GothamBold
title.TextSize = 11
local function createBtn(text, yPos, color, width)
local b = Instance.new("TextButton", frame)
b.Size = UDim2.new(0, width or 240, 0, 35)
b.Position = UDim2.new(0, 10, 0, yPos)
b.Text = text
b.BackgroundColor3 = color
b.TextColor3 = Color3.new(1, 1, 1)
b.Font = Enum.Font.GothamBold
b.TextSize = 9
Instance.new("UICorner", b).CornerRadius = UDim.new(0, 6)
return b
end
-- Primary UI Elements
local lockBtn = createBtn("1. LOCK BASE", 40, Color3.fromRGB(0, 120, 215))
local collectBtn = createBtn("2. COLLECT BUTTONS: OFF", 85, Color3.fromRGB(180, 40, 40))
local screenBtn = createBtn("3. COLLECT UPGRADE BUTTONS: OFF", 130, Color3.fromRGB(180, 40, 40))
local disasterBtn = createBtn("4. REMOVE WAVES AND LAVA: OFF", 175, Color3.fromRGB(120, 40, 180))
-- Teleport row
local tpBtn = createBtn("5. QUICK TP TO MAINBASE", 220, Color3.fromRGB(200, 150, 0), 160)
local returnToggle = createBtn("0.5s RETURN", 220, Color3.fromRGB(45, 45, 45), 75)
returnToggle.Position = UDim2.new(0, 175, 0, 220)
local endBtn = createBtn("6. TP TO END", 265, Color3.fromRGB(150, 0, 0))
-- State indicators
collectBtn.Visible, screenBtn.Visible, tpBtn.Visible, returnToggle.Visible, endBtn.Visible = false, false, false, false, false
local disclaimer = Instance.new("TextLabel", frame)
disclaimer.Size = UDim2.new(1, -20, 0, 40)
disclaimer.Position = UDim2.new(0, 10, 0, 310)
disclaimer.BackgroundTransparency = 1
disclaimer.Text = "DISCLAIMER: You must stand on your base floor and click 'LOCK BASE' to start."
disclaimer.TextColor3 = Color3.fromRGB(180, 70, 70)
disclaimer.TextSize = 9
disclaimer.TextWrapped = true
disclaimer.Font = Enum.Font.GothamBold
-- Logic Variables
local lockedPlot, padsActive, screensActive, disasterActive, autoReturn = nil, false, false, false, false
local originalPads, originalScreens, platesFolder = {}, {}, nil
local lavaPositions = {
CFrame.new(-7221.87891, -34.9, -371.975),
CFrame.new(-1193.87903, -34.9, -371.975),
CFrame.new(-3241.87891, -34.9, -371.975),
CFrame.new(-5289.87891, -34.9, -371.975)
}
-- Teleport Logic
local function handleTeleport(targetCF)
local char = player.Character
local root = char and char:FindFirstChild("HumanoidRootPart")
if not root then return end
local oldPos = root.CFrame
root.CFrame = targetCF
if autoReturn then
task.wait(0.5) -- Teleport back after half a second
root.CFrame = oldPos
end
end
returnToggle.MouseButton1Click:Connect(function()
autoReturn = not autoReturn
returnToggle.BackgroundColor3 = autoReturn and Color3.fromRGB(40, 180, 80) or Color3.fromRGB(45, 45, 45)
returnToggle.Text = autoReturn and "RETURN: ON" or "0.5s RETURN"
end)
tpBtn.MouseButton1Click:Connect(function()
if not lockedPlot then return end
local mainBase = lockedPlot:FindFirstChild("MainBase", true)
if mainBase and mainBase:IsA("BasePart") then
handleTeleport(mainBase.CFrame + Vector3.new(0, 4, 0))
end
end)
endBtn.MouseButton1Click:Connect(function()
handleTeleport(CFrame.new(-8016, -10, -381))
end)
-- Disaster/Lava Cleanup
RunService.Heartbeat:Connect(function()
if disasterActive then
local dFolder = workspace:FindFirstChild("DisasterItems")
if dFolder then dFolder:ClearAllChildren() end
for _, v in ipairs(workspace:GetChildren()) do
if v.Name == "LavaFloor" then v:Destroy() end
end
if not platesFolder then
platesFolder = Instance.new("Folder", workspace)
platesFolder.Name = "SafetyPlates_Final"
for _, cf in ipairs(lavaPositions) do
local plate = Instance.new("Part")
plate.Size = Vector3.new(2050, 2, 2000)
plate.CFrame = cf
plate.Anchored, plate.Material, plate.Color, plate.Transparency = true, Enum.Material.Neon, Color3.fromRGB(0, 255, 255), 0.5
plate.Parent = platesFolder
end
end
end
end)
disasterBtn.MouseButton1Click:Connect(function()
disasterActive = not disasterActive
disasterBtn.Text = disasterActive and "WAVES/LAVA: REMOVED" or "4. REMOVE WAVES AND LAVA: OFF"
disasterBtn.BackgroundColor3 = disasterActive and Color3.fromRGB(40, 180, 80) or Color3.fromRGB(120, 40, 180)
if not disasterActive and platesFolder then platesFolder:Destroy(); platesFolder = nil end
end)
-- Initial Lock Sequence
lockBtn.MouseButton1Click:Connect(function()
local char = player.Character
local root = char and char:FindFirstChild("HumanoidRootPart")
if not root then return end
local ray = Ray.new(root.Position, Vector3.new(0, -50, 0))
local part = workspace:FindPartOnRay(ray, char)
if part then
local current = part
while current ~= workspace and current ~= nil do
if current.Parent and current.Parent.Name == "Plots" then
lockedPlot = current
lockBtn.Text = "BASE LOCKED ✓"
lockBtn.BackgroundColor3 = Color3.fromRGB(40, 180, 80)
collectBtn.Visible, screenBtn.Visible, tpBtn.Visible, returnToggle.Visible, endBtn.Visible = true, true, true, true, true
disclaimer.Text = "Base detected. All tools are now active."
disclaimer.TextColor3 = Color3.fromRGB(150, 150, 150)
return
end
current = current.Parent
end
end
end)
-- Item Snapping
collectBtn.MouseButton1Click:Connect(function()
if not lockedPlot then return end
padsActive = not padsActive
local root = player.Character.HumanoidRootPart
if padsActive then
collectBtn.Text = "COLLECT BUTTONS: SNAPPED"; collectBtn.BackgroundColor3 = Color3.fromRGB(40, 180, 80)
for _, group in ipairs(lockedPlot.Items:GetChildren()) do
local pad = group:FindFirstChild("CollectPad")
if pad then
originalPads[pad] = {cf = pad.CFrame, cc = pad.CanCollide, anc = pad.Anchored}
pad.CanCollide, pad.Anchored, pad.CFrame = false, true, root.CFrame * CFrame.new(0, 0, -5)
end
end
else
collectBtn.Text = "2. COLLECT BUTTONS: OFF"; collectBtn.BackgroundColor3 = Color3.fromRGB(180, 40, 40)
for pad, data in pairs(originalPads) do if pad.Parent then pad.CFrame, pad.CanCollide, pad.Anchored = data.cf, data.cc, data.anc end end
originalPads = {}
end
end)
screenBtn.MouseButton1Click:Connect(function()
if not lockedPlot then return end
screensActive = not screensActive
local root = player.Character.HumanoidRootPart
if screensActive then
screenBtn.Text = "UPGRADES: SNAPPED"; screenBtn.BackgroundColor3 = Color3.fromRGB(40, 180, 80)
local startCf, count = root.CFrame * CFrame.new(-6, 3, -10), 0
for _, group in ipairs(lockedPlot.Items:GetChildren()) do
local screen = group:FindFirstChild("Screen")
if screen then
originalScreens[screen] = {cf = screen.CFrame, cc = screen.CanCollide, anc = screen.Anchored}
screen.CanCollide, screen.Anchored = false, true
screen.CFrame = startCf * CFrame.new((count % 6) * 2.5, math.floor(count / 6) * -2.5, 0)
count = count + 1
end
end
else
screenBtn.Text = "3. COLLECT UPGRADE BUTTONS: OFF"; screenBtn.BackgroundColor3 = Color3.fromRGB(180, 40, 40)
for screen, data in pairs(originalScreens) do if screen.Parent then screen.CFrame, screen.CanCollide, screen.Anchored = data.cf, data.cc, data.anc end end
originalScreens = {}
end
end)
-- Draggable Logic
local dragging, dragStart, startPos
dragBar.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then dragging, dragStart, startPos = true, input.Position, frame.Position end end)
UserInputService.InputChanged:Connect(function(input) if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then local delta = input.Position - dragStart frame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y) end end)
UserInputService.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then dragging = false end end)
Comments
No comments yet
Be the first to share your thoughts!