BobloScript.com

Retail Tycoon 2 script: Better manager

Published by bebraOriginal developer: CLGPublished Jul 6
Open in Roblox
200Views
98Copies
NeverUpdated

Script Code

Raw code
local RS = game:GetService("ReplicatedStorage")local RSvc = game:GetService("RunService")local TS = game:GetService("TweenService")local UIS = game:GetService("UserInputService")local RefrInt = 2local TrackCfg = {}local GUIVisible = truelocal GetStorage = RS:WaitForChild("Remotes", 5):WaitForChild("GetStorage", 5)local BuyStorage = RS:WaitForChild("Remotes", 5):WaitForChild("BuyStorage", 5)if not GetStorage or not BuyStorage then	warn("Remote function failure.")	returnendlocal Gui = Instance.new("ScreenGui")Gui.Name = "BtrMgr"Gui.IgnoreGuiInset = trueGui.ResetOnSpawn = falseGui.Parent = gethui()local MainFrm = Instance.new("Frame")MainFrm.Name = "MainFrame"MainFrm.Size = UDim2.new(0, 600, 0, 500)MainFrm.Position = UDim2.new(0.5, -300, 0.5, -250)MainFrm.BackgroundColor3 = Color3.fromRGB(26, 28, 36)MainFrm.BorderSizePixel = 0MainFrm.ClipsDescendants = trueMainFrm.Parent = Guilocal MainCnr = Instance.new("UICorner")MainCnr.CornerRadius = UDim.new(0, 16)MainCnr.Parent = MainFrmlocal Header = Instance.new("Frame")Header.Name = "Header"Header.Size = UDim2.new(1, 0, 0, 60)Header.BackgroundTransparency = 1Header.ZIndex = 2Header.Parent = MainFrmlocal TitleCont = Instance.new("Frame")TitleCont.Name = "TitleContainer"TitleCont.Size = UDim2.new(1, -120, 1, 0)TitleCont.BackgroundTransparency = 1TitleCont.ZIndex = 2TitleCont.Parent = Headerlocal TitleLbl = Instance.new("TextLabel")TitleLbl.Name = "Title"TitleLbl.Size = UDim2.new(1, -70, 1, 0)TitleLbl.Position = UDim2.new(0, 20, 0, 0)TitleLbl.BackgroundTransparency = 1TitleLbl.Text = "Better Manager"TitleLbl.Font = Enum.Font.GothamBoldTitleLbl.TextSize = 20TitleLbl.TextColor3 = Color3.fromRGB(255, 255, 255)TitleLbl.TextXAlignment = Enum.TextXAlignment.LeftTitleLbl.TextYAlignment = Enum.TextYAlignment.CenterTitleLbl.ZIndex = 2TitleLbl.Parent = TitleContlocal CredLbl = Instance.new("TextLabel")CredLbl.Name = "Credits"CredLbl.Size = UDim2.new(0, 150, 1, 0)CredLbl.Position = UDim2.new(0, 180, 0, 0)CredLbl.BackgroundTransparency = 1CredLbl.Text = "v1.0 by Lilah"CredLbl.Font = Enum.Font.GothamCredLbl.TextSize = 12CredLbl.TextColor3 = Color3.fromRGB(150, 155, 170)CredLbl.TextXAlignment = Enum.TextXAlignment.LeftCredLbl.TextYAlignment = Enum.TextYAlignment.CenterCredLbl.ZIndex = 2CredLbl.Parent = TitleContlocal ControlsCont = Instance.new("Frame")ControlsCont.Name = "Controls"ControlsCont.Size = UDim2.new(0, 110, 0, 40)ControlsCont.Position = UDim2.new(1, -120, 0.5, -20)ControlsCont.BackgroundTransparency = 1ControlsCont.ZIndex = 2ControlsCont.Parent = Headerlocal ControlsLyt = Instance.new("UIListLayout")ControlsLyt.FillDirection = Enum.FillDirection.HorizontalControlsLyt.HorizontalAlignment = Enum.HorizontalAlignment.RightControlsLyt.VerticalAlignment = Enum.VerticalAlignment.CenterControlsLyt.Padding = UDim.new(0, 10)ControlsLyt.Parent = ControlsContlocal MinBtn = Instance.new("TextButton")MinBtn.Name = "MinimizeBtn"MinBtn.Size = UDim2.new(0, 40, 0, 40)MinBtn.BackgroundColor3 = Color3.fromRGB(40, 43, 54)MinBtn.BorderSizePixel = 0MinBtn.Text = "—"MinBtn.Font = Enum.Font.GothamBoldMinBtn.TextSize = 18MinBtn.TextColor3 = Color3.fromRGB(255, 255, 255)MinBtn.ZIndex = 2MinBtn.Parent = ControlsContlocal MinCnr = Instance.new("UICorner")MinCnr.CornerRadius = UDim.new(0, 8)MinCnr.Parent = MinBtnlocal CloseBtn = Instance.new("TextButton")CloseBtn.Name = "CloseBtn"CloseBtn.Size = UDim2.new(0, 40, 0, 40)CloseBtn.BackgroundColor3 = Color3.fromRGB(237, 66, 69)CloseBtn.BorderSizePixel = 0CloseBtn.Text = "X"CloseBtn.TextSize = 20CloseBtn.Font = Enum.Font.GothamBoldMinBtn.TextSize = 18CloseBtn.TextColor3 = Color3.fromRGB(255, 255, 255)CloseBtn.ZIndex = 2CloseBtn.Parent = ControlsContlocal CloseCnr = Instance.new("UICorner")CloseCnr.CornerRadius = UDim.new(0, 8)CloseCnr.Parent = CloseBtnlocal StatusB = Instance.new("Frame")StatusB.Name = "StatusBar"StatusB.Size = UDim2.new(1, -40, 0, 40)StatusB.Position = UDim2.new(0, 20, 0, 70)StatusB.BackgroundColor3 = Color3.fromRGB(35, 38, 48)StatusB.BorderSizePixel = 0StatusB.ZIndex = 2StatusB.Parent = MainFrmlocal StatusCnr = Instance.new("UICorner")StatusCnr.CornerRadius = UDim.new(0, 8)StatusCnr.Parent = StatusBlocal StatusLbl = Instance.new("TextLabel")StatusLbl.Name = "StatusText"StatusLbl.Size = UDim2.new(0.65, -10, 1, 0)StatusLbl.Position = UDim2.new(0, 10, 0, 0)StatusLbl.BackgroundTransparency = 1StatusLbl.Text = " Initializing..."StatusLbl.Font = Enum.Font.GothamStatusLbl.TextSize = 14StatusLbl.TextColor3 = Color3.fromRGB(180, 185, 200)StatusLbl.TextXAlignment = Enum.TextXAlignment.LeftStatusLbl.ZIndex = 2StatusLbl.Parent = StatusBlocal SearchBx = Instance.new("TextBox")SearchBx.Name = "SearchBox"SearchBx.Size = UDim2.new(0.35, -10, 0, 30)SearchBx.Position = UDim2.new(0.65, 5, 0.5, -15)SearchBx.BackgroundColor3 = Color3.fromRGB(45, 48, 60)SearchBx.BorderSizePixel = 0SearchBx.Text = ""SearchBx.PlaceholderText = " Search Stock..."SearchBx.Font = Enum.Font.GothamSearchBx.TextSize = 14SearchBx.TextColor3 = Color3.fromRGB(255, 255, 255)SearchBx.TextXAlignment = Enum.TextXAlignment.LeftSearchBx.TextScaled = trueSearchBx.ClearTextOnFocus = falseSearchBx.ZIndex = 2SearchBx.Parent = StatusBlocal SearchCnr = Instance.new("UICorner")SearchCnr.CornerRadius = UDim.new(0, 6)SearchCnr.Parent = SearchBxlocal ScrollFrm = Instance.new("ScrollingFrame")ScrollFrm.Name = "StockList"ScrollFrm.Size = UDim2.new(1, -40, 1, -130)ScrollFrm.Position = UDim2.new(0, 20, 0, 120)ScrollFrm.BackgroundTransparency = 1ScrollFrm.BorderSizePixel = 0ScrollFrm.ScrollBarThickness = 4ScrollFrm.ScrollBarImageColor3 = Color3.fromRGB(88, 101, 242)ScrollFrm.CanvasSize = UDim2.new(0, 0, 0, 0)ScrollFrm.ZIndex = 2ScrollFrm.Parent = MainFrmlocal ListLyt = Instance.new("UIListLayout")ListLyt.Padding = UDim.new(0, 8)ListLyt.SortOrder = Enum.SortOrder.NameListLyt.HorizontalAlignment = Enum.HorizontalAlignment.CenterListLyt.Parent = ScrollFrmListLyt:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()	ScrollFrm.CanvasSize = UDim2.new(0, 0, 0, ListLyt.AbsoluteContentSize.Y + 10)end)local function CreateEntry(IName)	local IFrm = Instance.new("Frame")	IFrm.Name = IName	IFrm.Size = UDim2.new(0.95, 0, 0, 80)	IFrm.BackgroundColor3 = Color3.fromRGB(35, 38, 48)	IFrm.BorderSizePixel = 0	IFrm.ClipsDescendants = true	IFrm.ZIndex = 2	local ICnr = Instance.new("UICorner")	ICnr.CornerRadius = UDim.new(0, 10)	ICnr.Parent = IFrm	local IStrk = Instance.new("UIStroke")	IStrk.Color = Color3.fromRGB(50, 54, 68)	IStrk.Thickness = 1	IStrk.Transparency = 0.5	IStrk.ApplyStrokeMode = Enum.ApplyStrokeMode.Border	IStrk.Parent = IFrm	local CntFrm = Instance.new("Frame")	CntFrm.Name = "ContentFrame"	CntFrm.Size = UDim2.new(1, -20, 1, -20)	CntFrm.Position = UDim2.new(0, 10, 0, 10)	CntFrm.BackgroundTransparency = 1	CntFrm.ZIndex = 2	CntFrm.Parent = IFrm	local NameLbl = Instance.new("TextLabel")	NameLbl.Name = "ItemName"	NameLbl.Size = UDim2.new(0.35, 0, 0, 25)	NameLbl.Position = UDim2.new(0, 0, 0, 0)	NameLbl.BackgroundTransparency = 1	NameLbl.Text = IName	NameLbl.Font = Enum.Font.GothamBold	NameLbl.TextSize = 16	NameLbl.TextColor3 = Color3.fromRGB(255, 255, 255)	NameLbl.TextXAlignment = Enum.TextXAlignment.Left	NameLbl.TextTruncate = Enum.TextTruncate.AtEnd	NameLbl.ZIndex = 2	NameLbl.Parent = CntFrm	local StockLbl = Instance.new("TextLabel")	StockLbl.Name = "StockAmount"	StockLbl.Size = UDim2.new(0.35, 0, 0, 20)	StockLbl.Position = UDim2.new(0, 0, 0, 30)	StockLbl.BackgroundTransparency = 1	StockLbl.Text = "Stock: 0"	StockLbl.Font = Enum.Font.Gotham	StockLbl.TextSize = 13	StockLbl.TextColor3 = Color3.fromRGB(150, 155, 170)	StockLbl.TextXAlignment = Enum.TextXAlignment.Left	StockLbl.ZIndex = 2	StockLbl.Parent = CntFrm	local MinCont = Instance.new("Frame")	MinCont.Name = "MinContainer"	MinCont.Size = UDim2.new(0.2, -5, 1, -10)	MinCont.Position = UDim2.new(0.35, 5, 0, 5)	MinCont.BackgroundTransparency = 1	MinCont.ZIndex = 2	MinCont.Parent = CntFrm	local MinLbl = Instance.new("TextLabel")	MinLbl.Size = UDim2.new(1, 0, 0, 18)	MinLbl.BackgroundTransparency = 1	MinLbl.Text = "Minimum Stock"	MinLbl.Font = Enum.Font.Gotham	MinLbl.TextSize = 11	MinLbl.TextColor3 = Color3.fromRGB(130, 135, 150)	MinLbl.TextXAlignment = Enum.TextXAlignment.Left	MinLbl.ZIndex = 2	MinLbl.Parent = MinCont	local MinBx = Instance.new("TextBox")	MinBx.Name = "MinBox"	MinBx.Size = UDim2.new(1, 0, 0, 32)	MinBx.Position = UDim2.new(0, 0, 0, 22)	MinBx.BackgroundColor3 = Color3.fromRGB(45, 48, 60)	MinBx.BorderSizePixel = 0	MinBx.Text = ""	MinBx.PlaceholderText = "0"	MinBx.Font = Enum.Font.GothamMedium	MinBx.TextSize = 14	MinBx.TextColor3 = Color3.fromRGB(255, 255, 255)	MinBx.ClearTextOnFocus = false	MinBx.ZIndex = 2	MinBx.Parent = MinCont	local MinBxCnr = Instance.new("UICorner")	MinBxCnr.CornerRadius = UDim.new(0, 6)	MinBxCnr.Parent = MinBx	local RACont = Instance.new("Frame")	RACont.Name = "RestockContainer"	RACont.Size = UDim2.new(0.2, -5, 1, -10)	RACont.Position = UDim2.new(0.55, 5, 0, 5)	RACont.BackgroundTransparency = 1	RACont.ZIndex = 2	RACont.Parent = CntFrm	local RALbl = Instance.new("TextLabel")	RALbl.Size = UDim2.new(1, 0, 0, 18)	RALbl.BackgroundTransparency = 1	RALbl.Text = "Restock Amount"	RALbl.Font = Enum.Font.Gotham	RALbl.TextSize = 11	RALbl.TextColor3 = Color3.fromRGB(130, 135, 150)	RALbl.TextXAlignment = Enum.TextXAlignment.Left	RALbl.ZIndex = 2	RALbl.Parent = RACont	local RABx = Instance.new("TextBox")	RABx.Name = "RestockBox"	RABx.Size = UDim2.new(1, 0, 0, 32)	RABx.Position = UDim2.new(0, 0, 0, 22)	RABx.BackgroundColor3 = Color3.fromRGB(45, 48, 60)	RABx.BorderSizePixel = 0	RABx.Text = ""	RABx.PlaceholderText = "0"	RABx.Font = Enum.Font.GothamMedium	RABx.TextSize = 14	RABx.TextColor3 = Color3.fromRGB(255, 255, 255)	RABx.ClearTextOnFocus = false	RABx.ZIndex = 2	RABx.Parent = RACont	local RABxCnr = Instance.new("UICorner")	RABxCnr.CornerRadius = UDim.new(0, 6)	RABxCnr.Parent = RABx	local TglBtn = Instance.new("TextButton")	TglBtn.Name = "ToggleBtn"	TglBtn.Size = UDim2.new(0.2, -10, 0, 50)	TglBtn.Position = UDim2.new(0.8, 5, 0.5, -25)	TglBtn.BackgroundColor3 = Color3.fromRGB(60, 63, 78)	TglBtn.BorderSizePixel = 0	TglBtn.Text = "OFF"	TglBtn.Font = Enum.Font.GothamBold	TglBtn.TextSize = 14	TglBtn.TextColor3 = Color3.fromRGB(180, 185, 200)	TglBtn.ZIndex = 2	TglBtn.Parent = CntFrm	local TglCnr = Instance.new("UICorner")	TglCnr.CornerRadius = UDim.new(0, 8)	TglCnr.Parent = TglBtn	local StatusDot = Instance.new("Frame")	StatusDot.Name = "StatusDot"	StatusDot.Size = UDim2.new(0, 8, 0, 8)	StatusDot.Position = UDim2.new(0, 10, 0, 10)	StatusDot.BackgroundColor3 = Color3.fromRGB(100, 105, 120)	StatusDot.BorderSizePixel = 0	StatusDot.ZIndex = 3	StatusDot.Parent = TglBtn	local DotCnr = Instance.new("UICorner")	DotCnr.CornerRadius = UDim.new(1, 0)	DotCnr.Parent = StatusDot	return IFrm, NameLbl, StockLbl, MinBx, RABx, TglBtn, IStrk, StatusDotendlocal IsDrg = falselocal DrgStrt, StrtPosHeader.InputBegan:Connect(function(Inp)	if Inp.UserInputType == Enum.UserInputType.MouseButton1 or Inp.UserInputType == Enum.UserInputType.Touch then		IsDrg = true		DrgStrt = Inp.Position		StrtPos = MainFrm.Position	endend)UIS.InputChanged:Connect(function(Inp)	if		IsDrg		and (Inp.UserInputType == Enum.UserInputType.MouseMovement or Inp.UserInputType == Enum.UserInputType.Touch)	then		local Delta = Inp.Position - DrgStrt		MainFrm.Position =			UDim2.new(StrtPos.X.Scale, StrtPos.X.Offset + Delta.X, StrtPos.Y.Scale, StrtPos.Y.Offset + Delta.Y)	endend)UIS.InputEnded:Connect(function(Inp)	if Inp.UserInputType == Enum.UserInputType.MouseButton1 or Inp.UserInputType == Enum.UserInputType.Touch then		IsDrg = false	endend)local function AnimateBtn(Btn, HvColor, PrsColor)	local OrigColor = Btn.BackgroundColor3	Btn.MouseEnter:Connect(function()		TS:Create(Btn, TweenInfo.new(0.2), { BackgroundColor3 = HvColor }):Play()	end)	Btn.MouseLeave:Connect(function()		TS:Create(Btn, TweenInfo.new(0.2), { BackgroundColor3 = OrigColor }):Play()	end)	Btn.MouseButton1Down:Connect(function()		TS:Create(Btn, TweenInfo.new(0.1), { BackgroundColor3 = PrsColor }):Play()	end)	Btn.MouseButton1Up:Connect(function()		TS:Create(Btn, TweenInfo.new(0.1), { BackgroundColor3 = HvColor }):Play()	end)endAnimateBtn(MinBtn, Color3.fromRGB(50, 54, 68), Color3.fromRGB(35, 38, 50))AnimateBtn(CloseBtn, Color3.fromRGB(255, 80, 82), Color3.fromRGB(220, 50, 52))local IsMin = falselocal FSize = MainFrm.SizeMinBtn.MouseButton1Click:Connect(function()	IsMin = not IsMin	local TSize = IsMin and UDim2.new(FSize.X.Scale, FSize.X.Offset, 0, 60) or FSize	MinBtn.Text = IsMin and "" or "—"	TS:Create(MainFrm, TweenInfo.new(0.3, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), { Size = TSize }):Play()end)CloseBtn.MouseButton1Click:Connect(function()	local CloseTwn = TS:Create(		MainFrm,		TweenInfo.new(0.3, Enum.EasingStyle.Back, Enum.EasingDirection.In),		{ Size = UDim2.new(0, 0, 0, 0), Position = UDim2.new(0.5, 0, 0.5, 0) }	)	CloseTwn:Play()	CloseTwn.Completed:Connect(function()		Gui:Destroy()	end)end)local function ToggleGUI()	GUIVisible = not GUIVisible	local TSize = GUIVisible and FSize or UDim2.new(0, 0, 0, 0)	local TPos = GUIVisible and UDim2.new(0.5, -300, 0.5, -250) or UDim2.new(0.5, 0, 0.5, 0)	local ES = GUIVisible and Enum.EasingStyle.Back or Enum.EasingStyle.Back	local ED = GUIVisible and Enum.EasingDirection.Out or Enum.EasingDirection.In	IsMin = false	MinBtn.Text = "—"	TS:Create(MainFrm, TweenInfo.new(0.5, ES, ED), { Size = TSize, Position = TPos }):Play()endUIS.InputBegan:Connect(function(Inp, GPE)	if Inp.KeyCode == Enum.KeyCode.RightShift and not GPE then		ToggleGUI()	endend)local function FilterList(SText)	local LSText = SText:lower()	for _, IFrm in ScrollFrm:GetChildren() do		if IFrm:IsA("Frame") and IFrm.Name ~= "UIListLayout" then			local IName = IFrm.Name:lower()			IFrm.Visible = IName:match(LSText) or SText == ""		end	end	ListLyt.AbsoluteContentSize = Vector2.new(0, 0)endSearchBx.Changed:Connect(function(Prop)	if Prop == "Text" then		FilterList(SearchBx.Text)	endend)SearchBx.FocusLost:Connect(function()	FilterList(SearchBx.Text)end)local function GetNum(TBx)	local Txt = TBx.Text:gsub("[^0-9]", "")	return tonumber(Txt) or 0endlocal function UpdCfg(IName, MinS, RAmt)	TrackCfg[IName] = TrackCfg[IName] or { Min = 0, Restock = 1, Active = false, LastStock = 0, BelowThreshold = false }	if MinS then		TrackCfg[IName].Min = math.max(0, math.floor(MinS))	end	if RAmt then		TrackCfg[IName].Restock = math.max(1, math.floor(RAmt))	endendlocal function UpdUI(SData)	for IName, Amt in pairs(SData) do		local IEntry = ScrollFrm:FindFirstChild(IName)		if not IEntry then			local F, NL, SL, MinB, RAB, TglB, Strk, SDot = CreateEntry(IName)			F.Parent = ScrollFrm			IEntry = F			UpdCfg(IName, 0, 1)			local CntFrm = IEntry:FindFirstChild("ContentFrame")			local MBCont = CntFrm and CntFrm:FindFirstChild("MinContainer")			local FMinB = MBCont and MBCont:FindFirstChild("MinBox")			local RBCont = CntFrm and CntFrm:FindFirstChild("RestockContainer")			local FRAB = RBCont and RBCont:FindFirstChild("RestockBox")			local FTglB = CntFrm and CntFrm:FindFirstChild("ToggleBtn")			local FSDot = FTglB and FTglB:FindFirstChild("StatusDot")			if FMinB then				FMinB.FocusLost:Connect(function()					local V = GetNum(FMinB)					FMinB.Text = tostring(V)					UpdCfg(IName, V, nil)				end)			end			if FRAB then				FRAB.FocusLost:Connect(function()					local V = GetNum(FRAB)					FRAB.Text = tostring(V)					UpdCfg(IName, nil, V)				end)			end			if FTglB and FSDot then				FTglB.MouseButton1Click:Connect(function()					local Cfg = TrackCfg[IName]					Cfg.Active = not Cfg.Active					local TC = Cfg.Active and Color3.fromRGB(67, 181, 129) or Color3.fromRGB(60, 63, 78)					local TXC = Cfg.Active and Color3.fromRGB(255, 255, 255) or Color3.fromRGB(180, 185, 200)					local DC = Cfg.Active and Color3.fromRGB(100, 255, 150) or Color3.fromRGB(100, 105, 120)					TS:Create(FTglB, TweenInfo.new(0.3), { BackgroundColor3 = TC, TextColor3 = TXC }):Play()					TS:Create(FSDot, TweenInfo.new(0.3), { BackgroundColor3 = DC }):Play()					FTglB.Text = Cfg.Active and "ON" or "OFF"					Cfg.BelowThreshold = false				end)				AnimateBtn(					FTglB,					TrackCfg[IName].Active and Color3.fromRGB(77, 191, 139) or Color3.fromRGB(70, 73, 88),					TrackCfg[IName].Active and Color3.fromRGB(57, 171, 119) or Color3.fromRGB(50, 53, 68)				)			end		end		local CntFrm = IEntry:FindFirstChild("ContentFrame")		local SL = CntFrm and CntFrm:FindFirstChild("StockAmount")		local IStrk = IEntry:FindFirstChild("UIStroke")		local Cfg = TrackCfg[IName]		if SL and Cfg then			SL.Text = string.format("Stock: %d", Amt)			Cfg.LastStock = Amt			local SC, GC			if Cfg.Active then				if Amt <= Cfg.Min then					SC = Color3.fromRGB(255, 165, 50)					GC = Color3.fromRGB(255, 140, 50)				else					SC = Color3.fromRGB(100, 255, 150)					GC = Color3.fromRGB(67, 181, 129)				end			else				SC = Color3.fromRGB(150, 155, 170)				GC = Color3.fromRGB(50, 54, 68)			end			TS:Create(SL, TweenInfo.new(0.3), { TextColor3 = SC }):Play()			TS:Create(IStrk, TweenInfo.new(0.3), { Color = GC }):Play()		end	endendlocal function BuyS(IName, Cfg)	local CS = Cfg.LastStock or 0	local MS = Cfg.Min or 0	local RA = Cfg.Restock or 0	local Amt = (MS + RA) - CS	if Amt <= 0 then		print(string.format("[AR] Skipping %s — stock sufficient.", IName))		return	end	local S, R = pcall(function()		return BuyStorage:InvokeServer(IName, Amt, false)	end)	if S and R then		StatusLbl.Text = string.format(" Restocked: %s x%d", IName, Amt)		print(string.format("[AR] Purchased %s x%d.", IName, Amt))		task.wait(3)	elseif S then		StatusLbl.Text = string.format("️ Failed: %s (Msg: %s)", IName, tostring(R))		warn(string.format("[AR] Purchase failed for %s. Server returned: %s", IName, tostring(R)))		task.wait(2)	else		StatusLbl.Text = string.format(" Error: %s (Err: %s)", IName, tostring(R))		warn(string.format("[AR] Error for %s: %s", IName, R))		task.wait(2)	endendlocal function Monitor()	while task.wait(RefrInt) do		if not RSvc:IsRunning() then			continue		end		local S, D = pcall(function()			return GetStorage:InvokeServer()		end)		if S and type(D) == "table" then			StatusLbl.Text = " Refreshing stock..."			UpdUI(D)			for IName, Cfg in pairs(TrackCfg) do				if Cfg.Active then					local CS = Cfg.LastStock					local MS = Cfg.Min					if CS <= MS and not Cfg.BelowThreshold then						Cfg.BelowThreshold = true						StatusLbl.Text = string.format(" Restocking %s...", IName)						task.spawn(function()							BuyS(IName, Cfg)						end)					elseif CS > MS and Cfg.BelowThreshold then						Cfg.BelowThreshold = false					end				end			end			StatusLbl.Text = string.format(" Idle • Last check: %s", os.date("%H:%M:%S"))		elseif S then			warn("GetStorage returned non-table: " .. tostring(D))			StatusLbl.Text = "️ Invalid data received"		else			warn("GetStorage call failed: " .. tostring(D))			StatusLbl.Text = " Connection error"		end	endendMainFrm.Size = UDim2.new(0, 0, 0, 0)MainFrm.Position = UDim2.new(0.5, 0, 0.5, 0)TS:Create(MainFrm, TweenInfo.new(0.5, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {	Size = UDim2.new(0, 600, 0, 500),	Position = UDim2.new(0.5, -300, 0.5, -250),}):Play()task.delay(0.5, function()	task.spawn(Monitor)end)
Latest changeScript publishedJul 6

Description

Retail Tycoon 2 is not only about building a nice store. The hard part is keeping every product in stock without wasting too much money. If shelves go empty, customers cannot buy what they came for. If you order too much, your cash gets stuck in storage instead of helping you expand the store. The CLG Better Manager script is made to fix that problem with smarter stock control. Instead of relying on slow or inefficient manager behavior, the GUI lets you set a minimum stock value and a restock amount for each product. When an item drops below your selected minimum, the script automatically orders more of it. For example, if Small Furniture goes under 200 stock, the GUI can order 200 more without you checking it manually. This is useful when your store has many different product types and you do not want to open menus every few minutes just to keep everything supplied. The script can manage one product, several products, or every available product in the game. That makes it useful for both smaller stores and bigger tycoons with many shelves, storage areas, and product categories. The search bar also makes it easier to find the item you need instead of scrolling through a huge list. There is no instant delivery option because instant delivery can cut into profit. This setup is better for players who want more efficient restocking, better cash control, and a store that keeps running without wasting money on unnecessary orders. Press Right Shift to hide or show the GUI, or use the buttons in the top-right corner. The script was tested on Potassium and should work on many executors, including lower-level ones like Solara and Xeno, because it does not depend on high-level functions.

Functions

  • Better manager

Comments

Loading comments…