local Players = game:GetService("Players") local ReplicatedStorage = game:GetService("ReplicatedStorage") local TweenService = game:GetService("TweenService") local UserInputService = game:GetService("UserInputService") local CoreGui = game:GetService("CoreGui") local LP = Players.LocalPlayer local Plot = ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("Plot") local SkipVote = ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("SkipVote") local tweenInfo = TweenInfo.new(0.25, Enum.EasingStyle.Cubic, Enum.EasingDirection.Out) local maxSlots = 31 local slotCache, slotScanAt = nil, 0 local on = { repair = false, door = false, units = false, skip = false } local busy = { repair = false, door = false, units = false, skip = false } local function waitWhile(active, seconds) local t = 0 while active() and t < seconds do task.wait(0.1) t += 0.1 end end local function slotNum(name) local n = tonumber(string.match(tostring(name), "%d+")) return n and n > 0 and n or nil end local function myPlot() local uid = LP.UserId local roots = { workspace:FindFirstChild("Plots"), workspace:FindFirstChild("Plot"), workspace:FindFirstChild("Map") and workspace.Map:FindFirstChild("Plots"), } for _, root in roots do if root then for _, p in root:GetChildren() do for _, key in { "OwnerId", "Owner", "PlayerUserId", "UserId" } do local v = p:GetAttribute(key) if v == uid or v == LP.Name then return p end end local o = p:FindFirstChild("Owner") or p:FindFirstChild("OwnerId") if o then if o:IsA("ObjectValue") and o.Value == LP then return p end if o:IsA("IntValue") and o.Value == uid then return p end if o:IsA("StringValue") and (o.Value == LP.Name or tonumber(o.Value) == uid) then return p end end if string.find(string.lower(p.Name), string.lower(LP.Name), 1, true) then return p end end end end end local function pullSlots(from, out, seen) if not from then return end for _, d in from:GetDescendants() do if d:IsA("Model") or d:IsA("Folder") or d.Name:lower():find("unit") or d.Name:lower():find("slot") then local i = slotNum(d.Name) if i and not seen[i] then seen[i] = true table.insert(out, i) end end end for _, c in from:GetChildren() do local i = slotNum(c.Name) if i and not seen[i] then seen[i] = true table.insert(out, i) end end end local function unitSlots(refresh) local now = os.clock() if not refresh and slotCache and now - slotScanAt < 8 then return slotCache end local list, seen = {}, {} local plot = myPlot() if plot then for _, root in { plot:FindFirstChild("Units"), plot:FindFirstChild("UnitSlots"), plot:FindFirstChild("Towers"), plot:FindFirstChild("Brainrots"), plot } do pullSlots(root, list, seen) end end if #list == 0 then for i = 1, maxSlots do list[i] = i end else table.sort(list) end slotCache, slotScanAt = list, now return list end local function shuffle(t) local copy = table.create(#t) for i, v in ipairs(t) do copy[i] = v end for i = #copy, 2, -1 do local j = math.random(i) copy[i], copy[j] = copy[j], copy[i] end return copy end for _, g in CoreGui:GetChildren() do if g.Name == "HOLD_THE_DOOR_NETSAINT" or g.Name == "PLOT_AUTO_GLASS_DECK" or g.Name == "REPAIR_DOOR_GLASS_DECK" then g:Destroy() end end local gui = Instance.new("ScreenGui") gui.Name = "HOLD_THE_DOOR_NETSAINT" gui.ResetOnSpawn = false gui.Parent = CoreGui local bar = Instance.new("Frame") bar.Size = UDim2.fromOffset(650, 65) bar.Position = UDim2.fromOffset(20, 80) bar.BackgroundColor3 = Color3.fromRGB(18, 22, 30) bar.BackgroundTransparency = 0.2 bar.BorderSizePixel = 0 bar.ClipsDescendants = true bar.Active = true bar.Parent = gui Instance.new("UICorner", bar).CornerRadius = UDim.new(0, 10) local barStroke = Instance.new("UIStroke", bar) barStroke.Thickness = 2 barStroke.Color = Color3.fromRGB(255, 255, 255) barStroke.Transparency = 0.7 local dot = Instance.new("Frame") dot.Size = UDim2.fromOffset(6, 25) dot.Position = UDim2.fromOffset(12, 20) dot.BackgroundColor3 = Color3.fromRGB(255, 75, 95) dot.BorderSizePixel = 0 dot.Parent = bar Instance.new("UICorner", dot).CornerRadius = UDim.new(1, 0) local title = Instance.new("TextLabel") title.Size = UDim2.new(0, 240, 1, 0) title.Position = UDim2.fromOffset(30, 0) title.BackgroundTransparency = 1 title.Text = "Hold The Door by Netsaint" title.TextColor3 = Color3.fromRGB(255, 255, 255) title.Font = Enum.Font.GothamBold title.TextSize = 11 title.TextXAlignment = Enum.TextXAlignment.Left title.TextYAlignment = Enum.TextYAlignment.Center title.Parent = bar local row = Instance.new("Frame") row.Size = UDim2.fromOffset(360, 35) row.Position = UDim2.new(1, -370, 0, 15) row.BackgroundTransparency = 1 row.Parent = bar local rowLayout = Instance.new("UIListLayout", row) rowLayout.FillDirection = Enum.FillDirection.Horizontal rowLayout.HorizontalAlignment = Enum.HorizontalAlignment.Right rowLayout.SortOrder = Enum.SortOrder.LayoutOrder rowLayout.Padding = UDim.new(0, 5) local function styleBtn(btn) Instance.new("UICorner", btn).CornerRadius = UDim.new(0, 6) local s = Instance.new("UIStroke", btn) s.Thickness = 1.2 s.Color = Color3.fromRGB(255, 255, 255) s.Transparency = 0.8 end local function mkBtn(name, order, text, w) local b = Instance.new("TextButton") b.Name = name b.LayoutOrder = order b.Size = UDim2.fromOffset(w, 35) b.BackgroundColor3 = Color3.fromRGB(255, 255, 255) b.BackgroundTransparency = 0.9 b.Text = text b.TextColor3 = Color3.fromRGB(220, 225, 235) b.Font = Enum.Font.GothamBold b.TextSize = 9 b.AutoButtonColor = false b.Parent = row styleBtn(b) return b end local function mkSplit(name, order, top, bottom, w) local b = Instance.new("TextButton") b.Name = name b.LayoutOrder = order b.Size = UDim2.fromOffset(w, 35) b.BackgroundColor3 = Color3.fromRGB(255, 255, 255) b.BackgroundTransparency = 0.9 b.Text = "" b.AutoButtonColor = false b.Parent = row styleBtn(b) local a = Instance.new("TextLabel", b) a.Name = "TopLabel" a.Size = UDim2.new(1, 0, 0, 11) a.Position = UDim2.fromOffset(0, 5) a.BackgroundTransparency = 1 a.Text = top a.TextColor3 = Color3.fromRGB(220, 225, 235) a.Font = Enum.Font.GothamMedium a.TextSize = 7 local c = Instance.new("TextLabel", b) c.Name = "BottomLabel" c.Size = UDim2.new(1, 0, 0, 13) c.Position = UDim2.fromOffset(0, 16) c.BackgroundTransparency = 1 c.Text = bottom c.TextColor3 = Color3.fromRGB(220, 225, 235) c.Font = Enum.Font.GothamBold c.TextSize = 9 return b end local btnRepair = mkBtn("Repair", 1, "REPAIR", 58) local btnDoor = mkSplit("Door", 2, "upgrade", "door", 48) local btnUnits = mkSplit("Units", 3, "upgrade", "units", 48) local btnSkip = mkSplit("Skip", 4, "vote", "skip", 48) local btnClose = mkBtn("Close", 5, "X", 30) btnClose.TextSize = 13 local dragging, dragFrom, dragAt = false, nil, nil bar.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging, dragFrom, dragAt = true, input.Position, bar.Position end end) bar.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = false end end) UserInputService.InputChanged:Connect(function(input) if not dragging then return end if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then local d = input.Position - dragFrom bar.Position = UDim2.new(dragAt.X.Scale, dragAt.X.Offset + d.X, dragAt.Y.Scale, dragAt.Y.Offset + d.Y) end end) local colors = { repair = Color3.fromRGB(0, 205, 255), door = Color3.fromRGB(255, 140, 60), units = Color3.fromRGB(255, 200, 80), skip = Color3.fromRGB(120, 255, 160), off = Color3.fromRGB(220, 225, 235), } local function paintBtn(btn, lit, col) local textCol = lit and col or colors.off TweenService:Create(btn, tweenInfo, { BackgroundTransparency = lit and 0.65 or 0.9 }):Play() if btn.Text ~= "" then TweenService:Create(btn, tweenInfo, { TextColor3 = textCol }):Play() end for _, label in btn:GetChildren() do if label:IsA("TextLabel") then TweenService:Create(label, tweenInfo, { TextColor3 = textCol }):Play() end end end local function paintDot() local n = (on.repair and 1 or 0) + (on.door and 1 or 0) + (on.units and 1 or 0) + (on.skip and 1 or 0) local col = Color3.fromRGB(255, 75, 95) if n > 0 then if n > 1 then col = Color3.fromRGB(210, 140, 255) elseif on.repair then col = colors.repair elseif on.door then col = colors.door elseif on.skip then col = colors.skip else col = colors.units end end TweenService:Create(dot, tweenInfo, { BackgroundColor3 = col }):Play() end local function loop(key, tick, gap) if busy[key] then return end busy[key] = true task.spawn(function() while on[key] do pcall(tick) waitWhile(function() return on[key] end, gap) end busy[key] = false end) end local function flip(key, btn, col, start) on[key] = not on[key] paintBtn(btn, on[key], col) paintDot() if on[key] then start() end end btnRepair.MouseButton1Click:Connect(function() flip("repair", btnRepair, colors.repair, function() loop("repair", function() Plot:InvokeServer("repairDoor") end, 1.75) end) end) btnDoor.MouseButton1Click:Connect(function() flip("door", btnDoor, colors.door, function() loop("door", function() Plot:InvokeServer("upgradeDoor") end, 1.75) end) end) btnUnits.MouseButton1Click:Connect(function() flip("units", btnUnits, colors.units, function() if busy.units then return end unitSlots(true) busy.units = true task.spawn(function() while on.units do for _, slot in shuffle(unitSlots(false)) do if not on.units then break end pcall(function() Plot:InvokeServer("upgradeUnit", slot) end) task.wait(0.04) end waitWhile(function() return on.units end, 0.35) end busy.units = false end) end) end) btnSkip.MouseButton1Click:Connect(function() flip("skip", btnSkip, colors.skip, function() loop("skip", function() SkipVote:FireServer() end, 1.75) end) end) btnClose.MouseButton1Click:Connect(function() on.repair, on.door, on.units, on.skip = false, false, false, false gui:Destroy() end)