Category: Uncategorized

  • code test






    How to Make Admin Panel Roblox Studio (Copy & Paste Guide)


    Roblox Tutorial

    How to Make Admin Panel Roblox Studio (Copy & Paste)

    This step-by-step guide shows you exactly how to make admin panel roblox studio with a modern UI, global announcements, fly/invisible/invincible toggles, and a server-wide luck system. All three scripts are included below in tidy, scrollable embeds with a one-click copy button.

    Target keyword: how to make admin panel roblox studio

    What you’ll build

    • Clean, scrollable Admin UI
    • Global announcement toasts
    • Fly / Invisible / Invincible
    • Server Luck ×2 with timer HUD

    Why it matters

    Knowing how to make admin panel roblox studio helps you moderate, test, and manage features quickly without manual commands.

    Prerequisites

    • Roblox Studio installed
    • RemoteEvents & GUI basics
    • LocalScripts / Server Scripts
    • ModuleScripts, DataStores, MessagingService

    Step 1 — RemoteEvents Setup (ReplicatedStorage)

    Create these RemoteEvents in ReplicatedStorage:

    1. AdminGlobalMessage
    2. GlobalMessage
    3. AdminAction
    4. LuckUpdate
    5. AdminClient

    Tip: Exact names are critical when you learn how to make admin panel roblox studio.

    Step 2 — AdminPanelClient (LocalScript)

    Place at StarterPlayer ➜ StarterPlayerScripts ➜ AdminPanelClient.

    -- AdminPanelClient — clean settings UI with scrolling Admin page
    -- Features: Announcement, Server Luck, Fly/Invisible/Invincible, Toast, Luck HUD, drag bar, F2 to open
    
    local ReplicatedStorage = game:GetService("ReplicatedStorage")
    local TweenService      = game:GetService("TweenService")
    local UserInputService  = game:GetService("UserInputService")
    local Players           = game:GetService("Players")
    local RunService        = game:GetService("RunService")
    
    local player        = Players.LocalPlayer
    local EVT_SEND_ANN  = ReplicatedStorage:WaitForChild("AdminGlobalMessage")
    local EVT_BROADCAST = ReplicatedStorage:WaitForChild("GlobalMessage")
    local EVT_ADMIN_ACT = ReplicatedStorage:WaitForChild("AdminAction")
    local EVT_LUCK_PUSH = ReplicatedStorage:WaitForChild("LuckUpdate")
    local EVT_ADMIN_CL  = ReplicatedStorage:WaitForChild("AdminClient")
    
    -- ---------- theme ----------
    local C = {
    	bg=Color3.fromRGB(14,14,18), card=Color3.fromRGB(23,23,29),
    	stroke=Color3.fromRGB(38,38,46), text=Color3.fromRGB(235,238,245),
    	sub=Color3.fromRGB(160,168,188), blue=Color3.fromRGB(60,110,230),
    	green=Color3.fromRGB(90,170,95), gray=Color3.fromRGB(120,120,130)
    }
    local FT = Enum.Font.Gotham
    local FB = Enum.Font.GothamBold
    
    -- ---------- toast ----------
    local toastGui = Instance.new("ScreenGui")
    toastGui.Name, toastGui.IgnoreGuiInset, toastGui.ResetOnSpawn, toastGui.DisplayOrder = "Toast", true, false, 1500
    toastGui.Parent = player:WaitForChild("PlayerGui")
    
    local TOAST_W, TOAST_H, TOAST_Y = 520, 58, 0.32
    local toast = Instance.new("Frame")
    toast.Size = UDim2.new(0,TOAST_W,0,TOAST_H)
    toast.Position = UDim2.new(0.5,-TOAST_W/2,TOAST_Y,0)
    toast.Visible = false
    toast.BackgroundColor3 = C.card
    toast.Parent = toastGui
    Instance.new("UICorner", toast).CornerRadius = UDim.new(0,10)
    do local s=Instance.new("UIStroke",toast) s.Color=C.stroke s.Thickness=1 end
    
    local toastLabel = Instance.new("TextLabel")
    toastLabel.BackgroundTransparency = 1
    toastLabel.Size = UDim2.new(1,-24,1,0)
    toastLabel.Position = UDim2.new(0,12,0,0)
    toastLabel.Font = FB; toastLabel.TextScaled = true
    toastLabel.TextColor3 = C.text
    toastLabel.Parent = toast
    
    local function showToast(text, color)
    	toastLabel.Text = text; toastLabel.TextColor3 = color or C.text
    	toast.Visible = true
    	toast.Position = UDim2.new(0.5,-TOAST_W/2,TOAST_Y+0.03,0)
    	toast.BackgroundTransparency = 0.35
    	toastLabel.TextTransparency = 1
    	TweenService:Create(toast,TweenInfo.new(0.18,Enum.EasingStyle.Quad,Enum.EasingDirection.Out),
    		{Position=UDim2.new(0.5,-TOAST_W/2,TOAST_Y,0), BackgroundTransparency=0.1}):Play()
    	TweenService:Create(toastLabel,TweenInfo.new(0.18),{TextTransparency=0}):Play()
    	task.wait(2)
    	TweenService:Create(toast,TweenInfo.new(0.18,Enum.EasingStyle.Quad,Enum.EasingDirection.In),
    		{BackgroundTransparency=0.5}):Play()
    	TweenService:Create(toastLabel,TweenInfo.new(0.18),{TextTransparency=1}):Play()
    	task.wait(0.2); toast.Visible=false
    end
    EVT_BROADCAST.OnClientEvent:Connect(showToast)
    
    -- ---------- main panel ----------
    local gui = Instance.new("ScreenGui")
    gui.Name, gui.IgnoreGuiInset, gui.ResetOnSpawn, gui.DisplayOrder, gui.Enabled =
    	"ControlPanel", true, false, 2000, false
    gui.Parent = player.PlayerGui
    
    local PANEL_W, PANEL_H = 900, 580
    local panel = Instance.new("Frame")
    panel.Size = UDim2.new(0,PANEL_W,0,PANEL_H)
    panel.Position = UDim2.new(0.5,-PANEL_W/2,0.5,-PANEL_H/2)
    panel.BackgroundColor3 = C.bg
    panel.Parent = gui
    Instance.new("UICorner", panel).CornerRadius = UDim.new(0,12)
    do local s=Instance.new("UIStroke",panel) s.Color=C.stroke s.Thickness=1 end
    do local p=Instance.new("UIPadding",panel) p.PaddingTop=UDim.new(0,14) p.PaddingLeft=UDim.new(0,14) p.PaddingRight=UDim.new(0,14) end
    
    local title = Instance.new("TextLabel")
    title.BackgroundTransparency=1; title.Size=UDim2.new(1,-48,0,42)
    title.Text="Settings"; title.Font=FB; title.TextScaled=true; title.TextXAlignment=Enum.TextXAlignment.Left
    title.TextColor3=C.text; title.Parent=panel
    
    local closeBtn = Instance.new("TextButton")
    closeBtn.Size=UDim2.new(0,36,0,36); closeBtn.Position=UDim2.new(1,-44,0,2)
    closeBtn.Text="X"; closeBtn.TextScaled=true; closeBtn.Font=FB
    closeBtn.BackgroundColor3=Color3.fromRGB(140,50,50); closeBtn.TextColor3=Color3.new(1,1,1)
    Instance.new("UICorner",closeBtn).CornerRadius=UDim.new(0,10)
    closeBtn.Parent=panel
    closeBtn.MouseButton1Click:Connect(function() gui.Enabled=false end)
    
    -- tabs
    local tabs = Instance.new("Frame")
    tabs.Position=UDim2.new(0,0,0,52); tabs.Size=UDim2.new(1,0,0,42); tabs.BackgroundTransparency=1; tabs.Parent=panel
    local function makeTab(text, x)
    	local b=Instance.new("TextButton"); b.Size=UDim2.new(0,180,1,0); b.Position=UDim2.new(0,x,0,0)
    	b.Text=text; b.TextScaled=true; b.Font=FB; b.TextColor3=C.text; b.BackgroundColor3=C.card; b.Parent=tabs
    	Instance.new("UICorner",b).CornerRadius=UDim.new(0,10)
    	do local s=Instance.new("UIStroke",b) s.Color=C.stroke s.Thickness=1 end
    	return b
    end
    local tabAnn = makeTab("Announcement", 0)
    local tabAdmin = makeTab("Admin", 190)
    
    local content = Instance.new("Frame")
    content.Position=UDim2.new(0,0,0,100); content.Size=UDim2.new(1,0,1,-128)
    content.BackgroundTransparency=1; content.Parent=panel
    
    local pageAnn = Instance.new("Frame"); pageAnn.Size=UDim2.new(1,0,1,0); pageAnn.BackgroundTransparency=1; pageAnn.Parent=content
    local pageAdmin = Instance.new("Frame"); pageAdmin.Size=UDim2.new(1,0,1,0); pageAdmin.BackgroundTransparency=1; pageAdmin.Visible=false; pageAdmin.Parent=content
    
    local function showPage(w)
    	pageAnn.Visible = (w=="ann"); pageAdmin.Visible=(w=="admin")
    	tabAnn.BackgroundColor3 = (w=="ann") and C.blue or C.card
    	tabAdmin.BackgroundColor3 = (w=="admin") and C.blue or C.card
    end
    tabAnn.MouseButton1Click:Connect(function() showPage("ann") end)
    tabAdmin.MouseButton1Click:Connect(function() showPage("admin") end)
    showPage("ann")
    
    -- drag bar
    local dragBar = Instance.new("Frame")
    dragBar.Size=UDim2.new(1,0,0,8); dragBar.Position=UDim2.new(0,0,1,-8); dragBar.BackgroundColor3=Color3.new(1,1,1)
    dragBar.Parent=panel
    local function makeDraggable(handle,target)
    	local dragging=false; local start; local startPos
    	local function upd(input)
    		local d = input.Position - start
    		target.Position = UDim2.fromOffset(startPos.X.Offset + d.X, startPos.Y.Offset + d.Y)
    	end
    	handle.InputBegan:Connect(function(i)
    		if i.UserInputType==Enum.UserInputType.MouseButton1 or i.UserInputType==Enum.UserInputType.Touch then
    			dragging=true; start=i.Position; startPos=target.Position
    			i.Changed:Connect(function() if i.UserInputState==Enum.UserInputState.End then dragging=false end end)
    		end
    	end)
    	handle.InputChanged:Connect(function(i)
    		if dragging and (i.UserInputType==Enum.UserInputType.MouseMovement or i.UserInputType==Enum.UserInputType.Touch) then
    			upd(i)
    		end
    	end)
    end
    makeDraggable(dragBar, panel)
    
    -- F2 toggle
    UserInputService.InputBegan:Connect(function(input,gpe)
    	if gpe then return end
    	if input.KeyCode==Enum.KeyCode.F2 then gui.Enabled = not gui.Enabled end
    end)
    
    -- ---------- helpers (cards/rows) ----------
    local function card(parent, titleText, height)
    	local f=Instance.new("Frame"); f.Size=UDim2.new(1,0,0,height); f.BackgroundColor3=C.card; f.Parent=parent
    	Instance.new("UICorner",f).CornerRadius=UDim.new(0,12)
    	do local s=Instance.new("UIStroke",f) s.Color=C.stroke s.Thickness=1 end
    	local pad=Instance.new("UIPadding",f); pad.PaddingTop=UDim.new(0,14); pad.PaddingLeft=UDim.new(0,14); pad.PaddingRight=UDim.new(0,14)
    
    	local t=Instance.new("TextLabel"); t.BackgroundTransparency=1; t.Size=UDim2.new(1,0,0,26)
    	t.Text=titleText; t.TextScaled=true; t.Font=FB; t.TextXAlignment=Enum.TextXAlignment.Left; t.TextColor3=C.text; t.Parent=f
    
    	local list=Instance.new("UIListLayout", f); list.Padding=UDim.new(0,10); list.SortOrder=Enum.SortOrder.LayoutOrder
    	t.LayoutOrder=0
    	return f
    end
    
    local function row(parent, main, sub)
    	local f=Instance.new("Frame"); f.Name="Row"; f.Size=UDim2.new(1,0,0,64); f.BackgroundColor3=C.card
    	f.Parent=parent; f.LayoutOrder=1
    	Instance.new("UICorner",f).CornerRadius=UDim.new(0,10)
    	do local s=Instance.new("UIStroke",f) s.Color=C.stroke s.Thickness=1 end
    	local pad=Instance.new("UIPadding",f); pad.PaddingTop=UDim.new(0,12); pad.PaddingLeft=UDim.new(0,12); pad.PaddingRight=UDim.new(0,12)
    
    	local left=Instance.new("Frame"); left.BackgroundTransparency=1; left.Size=UDim2.new(1,-260,1,0); left.Parent=f
    	local title=Instance.new("TextLabel"); title.BackgroundTransparency=1; title.Size=UDim2.new(1,0,0,26)
    	title.Text=main; title.TextScaled=true; title.Font=FB; title.TextXAlignment=Enum.TextXAlignment.Left; title.TextColor3=C.text; title.Parent=left
    	local desc=Instance.new("TextLabel"); desc.BackgroundTransparency=1; desc.Position=UDim2.new(0,0,0,26); desc.Size=UDim2.new(1,0,0,20)
    	desc.Text=sub or ""; desc.TextScaled=true; desc.Font=FT; desc.TextXAlignment=Enum.TextXAlignment.Left; desc.TextColor3=C.sub; desc.Parent=left
    
    	local right=Instance.new("Frame"); right.BackgroundTransparency=1; right.Size=UDim2.new(0,240,1,0); right.Position=UDim2.new(1,-240,0,0); right.Parent=f
    	return f, right
    end
    
    local function pill(parent, text, color, cb)
    	local b=Instance.new("TextButton"); b.Size=UDim2.new(0,120,0,36); b.Position=UDim2.new(1,-120,0.5,-18)
    	b.BackgroundColor3=color; b.TextColor3=Color3.new(1,1,1); b.TextScaled=true; b.Font=FB; b.Text=text; b.Parent=parent
    	Instance.new("UICorner",b).CornerRadius=UDim.new(0,18)
    	b.MouseButton1Click:Connect(function() if cb then cb() end end)
    	return b
    end
    
    -- ---------- Announcement page ----------
    do
    	local a = card(pageAnn, "Announcement", 190)
    
    	local r, right = row(a, "Global message", "Broadcast a small popup to all players")
    
    	local input = Instance.new("TextBox")
    	input.Size = UDim2.new(1,-130,0,36)          -- BIGGER input
    	input.Position = UDim2.new(0,0,0.5,-18)
    	input.BackgroundColor3 = Color3.fromRGB(32,32,40)
    	input.TextColor3 = C.text; input.PlaceholderText = "type an announcement…"
    	input.TextScaled = true; input.ClearTextOnFocus = false; input.Font = FT
    	input.Parent = right
    	Instance.new("UICorner",input).CornerRadius=UDim.new(0,10)
    	do local s=Instance.new("UIStroke",input) s.Color=C.stroke s.Thickness=1 end
    
    	pill(right, "Send", C.blue, function()
    		local txt = input.Text
    		if txt and #txt > 0 then EVT_SEND_ANN:FireServer(txt, nil); input.Text = "" end
    	end)
    end
    
    -- ---------- Admin page (scrollable) ----------
    local adminCard = card(pageAdmin, "Admin", 430)
    
    -- make a ScrollingFrame inside the card for many rows
    local scroll = Instance.new("ScrollingFrame")
    scroll.Size = UDim2.new(1,-0,1,-46)
    scroll.Position = UDim2.new(0,0,0,46)
    scroll.BackgroundTransparency = 1
    scroll.ScrollBarThickness = 6
    scroll.AutomaticCanvasSize = Enum.AutomaticSize.Y
    scroll.CanvasSize = UDim2.new()
    scroll.Parent = adminCard
    
    local list = Instance.new("UIListLayout", scroll)
    list.Padding = UDim.new(0,10)
    list.SortOrder = Enum.SortOrder.LayoutOrder
    
    -- row: Server Luck
    do
    	local r, right = row(scroll, "Server Luck ×2", "Doubles global luck; stacks and resets the 5:00 timer")
    	pill(right, "Activate", C.green, function() EVT_ADMIN_ACT:FireServer("DoubleLuck") end)
    end
    
    -- row: Target player
    local targetBox
    do
    	local r, right = row(scroll, "Target player", "Leave blank to target yourself")
    	targetBox = Instance.new("TextBox")
    	targetBox.Size = UDim2.new(1,0,0,36)
    	targetBox.Position = UDim2.new(0,0,0.5,-18)
    	targetBox.BackgroundColor3 = Color3.fromRGB(32,32,40)
    	targetBox.TextColor3 = C.text; targetBox.PlaceholderText="name (optional)"
    	targetBox.TextScaled = true; targetBox.ClearTextOnFocus=false; targetBox.Font=FT
    	targetBox.Parent = right
    	Instance.new("UICorner",targetBox).CornerRadius=UDim.new(0,10)
    	do local s=Instance.new("UIStroke",targetBox) s.Color=C.stroke s.Thickness=1 end
    end
    
    -- row: Fly
    do
    	local r, right = row(scroll, "Fly (toggle)", "Grants flight to the target player")
    	pill(right, "Toggle", C.blue, function()
    		EVT_ADMIN_ACT:FireServer("FlyToggle", {target = targetBox.Text})
    	end)
    end
    
    -- row: Invisible
    do
    	local r, right = row(scroll, "Invisible (toggle)", "Hide character parts/decals for everyone")
    	pill(right, "Toggle", C.gray, function()
    		EVT_ADMIN_ACT:FireServer("InvisibleToggle", {target = targetBox.Text})
    	end)
    end
    
    -- row: Invincible
    do
    	local r, right = row(scroll, "Invincible (toggle)", "Locks Health to MaxHealth")
    	pill(right, "Toggle", C.green, function()
    		EVT_ADMIN_ACT:FireServer("InvincibleToggle", {target = targetBox.Text})
    	end)
    end
    
    -- ---------- Luck HUD ----------
    local hud = Instance.new("ScreenGui")
    hud.Name="LuckHUD"; hud.IgnoreGuiInset=true; hud.ResetOnSpawn=false; hud.DisplayOrder=1100; hud.Parent=player.PlayerGui
    local hudFrame = Instance.new("Frame")
    hudFrame.Size=UDim2.new(0,210,0,60); hudFrame.Position=UDim2.new(1,-220,1,-70)
    hudFrame.BackgroundColor3=C.card; hudFrame.Visible=false; hudFrame.Parent=hud
    Instance.new("UICorner",hudFrame).CornerRadius=UDim.new(0,10)
    do local s=Instance.new("UIStroke",hudFrame) s.Color=C.stroke s.Thickness=1 end
    local hudLabel = Instance.new("TextLabel")
    hudLabel.BackgroundTransparency=1; hudLabel.Size=UDim2.new(1,-16,0,24); hudLabel.Position=UDim2.new(0,8,0,6)
    hudLabel.Font=FB; hudLabel.TextScaled=true; hudLabel.TextColor3=Color3.fromRGB(120,220,120); hudLabel.Text="luck"; hudLabel.Parent=hudFrame
    local hudTimer = Instance.new("TextLabel")
    hudTimer.BackgroundTransparency=1; hudTimer.Size=UDim2.new(1,-16,0,22); hudTimer.Position=UDim2.new(0,8,0,32)
    hudTimer.Font=FT; hudTimer.TextScaled=true; hudTimer.TextColor3=C.text; hudTimer.Text="00:00"; hudTimer.Parent=hudFrame
    
    local currentMult, secondsLeft, lastTick = 1, 0, 0
    local function fmtTime(s) s = math.max(0, math.floor(s)); return string.format("%02d:%02d", math.floor(s/60), s%60) end
    local function refreshHUD()
    	if secondsLeft > 0 and currentMult > 1 then
    		hudFrame.Visible = true
    		hudLabel.Text = ("luck  x%d"):format(currentMult)
    		hudTimer.Text = fmtTime(secondsLeft)
    	else
    		hudFrame.Visible = false
    	end
    end
    EVT_LUCK_PUSH.OnClientEvent:Connect(function(mult, secs) currentMult, secondsLeft = mult, secs; refreshHUD() end)
    RunService.RenderStepped:Connect(function(dt)
    	if secondsLeft > 0 then
    		secondsLeft = math.max(0, secondsLeft - dt)
    		if math.floor(secondsLeft) ~= lastTick then lastTick = math.floor(secondsLeft); refreshHUD() end
    	end
    end)
    
    -- ---------- Local Fly controller ----------
    local flying=false; local lv,att,ao; local move=Vector3.zero; local up,down=0,0
    local function stopFly()
    	flying=false; if lv then lv:Destroy(); lv=nil end; if ao then ao:Destroy(); ao=nil end; if att then att:Destroy(); att=nil end
    	local ch=player.Character; if ch then local h=ch:FindFirstChildOfClass("Humanoid"); if h then h.PlatformStand=false end end
    end
    local function startFly()
    	local ch=player.Character or player.CharacterAdded:Wait()
    	local hrp=ch:WaitForChild("HumanoidRootPart"); local hum=ch:WaitForChild("Humanoid")
    	att=Instance.new("Attachment",hrp)
    	lv=Instance.new("LinearVelocity",hrp); lv.Attachment0=att; lv.MaxForce=1e6; lv.VelocityConstraintMode=Enum.VelocityConstraintMode.Vector
    	ao=Instance.new("AlignOrientation",hrp); ao.Mode=Enum.OrientationAlignmentMode.OneAttachment; ao.Attachment0=att; ao.MaxTorque=math.huge; ao.ReactionTorqueEnabled=true
    	hum.PlatformStand=true; flying=true
    end
    UserInputService.InputBegan:Connect(function(i,gpe)
    	if gpe then return end
    	if i.KeyCode==Enum.KeyCode.W then move=Vector3.new(move.X,move.Y,-1)
    	elseif i.KeyCode==Enum.KeyCode.S then move=Vector3.new(move.X,move.Y,1)
    	elseif i.KeyCode==Enum.KeyCode.A then move=Vector3.new(-1,move.Y,move.Z)
    	elseif i.KeyCode==Enum.KeyCode.D then move=Vector3.new(1,move.Y,move.Z)
    	elseif i.KeyCode==Enum.KeyCode.Space then up=1
    	elseif i.KeyCode==Enum.KeyCode.LeftControl then down=1 end
    end)
    UserInputService.InputEnded:Connect(function(i,gpe)
    	if i.KeyCode==Enum.KeyCode.W or i.KeyCode==Enum.KeyCode.S then move=Vector3.new(move.X,move.Y,0)
    	elseif i.KeyCode==Enum.KeyCode.A or i.KeyCode==Enum.KeyCode.D then move=Vector3.new(0,move.Y,move.Z)
    	elseif i.KeyCode==Enum.KeyCode.Space then up=0
    	elseif i.KeyCode==Enum.KeyCode.LeftControl then down=0 end
    end)
    RunService.RenderStepped:Connect(function(dt)
    	if not flying then return end
    	local ch=player.Character; if not ch then return end
    	local hrp=ch:FindFirstChild("HumanoidRootPart"); if not hrp then return end
    	local cam=workspace.CurrentCamera; local cf=CFrame.new(Vector3.zero, cam.CFrame.LookVector)
    	local dir=(cf.RightVector*move.X + cf.LookVector*(-move.Z)); local vert=up-down
    	local speed=60; lv.VectorVelocity=dir*speed + Vector3.new(0,vert*speed,0)
    	ao.CFrame=CFrame.new(Vector3.zero, (dir.Magnitude>0.001 and dir.Unit or cam.CFrame.LookVector))
    end)
    EVT_ADMIN_CL.OnClientEvent:Connect(function(action)
    	if action=="FlyToggle" then
    		if flying then stopFly() else startFly() end
    		showToast(flying and "fly: enabled" or "fly: disabled", flying and Color3.fromRGB(120,220,120) or Color3.fromRGB(220,120,120))
    	end
    end)

    Step 3 — AdminPanelServer (ServerScriptService)

    Create a Script named AdminPanelServer in ServerScriptService.

    AdminPanelServer Script
    The copy functionality for this script isn’t working properly in the embed.

    Get Script from Pastebin

    Step 4 — LuckManager (ModuleScript)

    Add a ModuleScript named LuckManager in ServerScriptService.

    -- ServerScriptService/LuckManager (ModuleScript)
    -- Global luck that doubles on demand and resets to 5:00. Cross-server in live games,
    -- safe no-op for Studio (no DataStore/Messaging errors).
    
    local RunService        = game:GetService("RunService")
    local MessagingService  = game:GetService("MessagingService")
    local DataStoreService  = game:GetService("DataStoreService")
    
    local LUCK_TOPIC    = "GLOBAL_LUCK_V1"
    local LUCK_DS       = DataStoreService:GetDataStore("LuckStateV1")
    local DEFAULT_MULT  = 1
    local DURATION_SECS = 5 * 60 -- 5 minutes
    local IS_STUDIO     = RunService:IsStudio()
    
    local State = { multiplier = DEFAULT_MULT, expiresAt = 0 } -- os.time()
    local Subscribers = {}
    
    local function now() return os.time() end
    local function secondsRemaining() return math.max(0, State.expiresAt - now()) end
    
    local function pushLocal()
    	for _, cb in ipairs(Subscribers) do
    		task.spawn(cb, State.multiplier, secondsRemaining())
    	end
    end
    
    local function applyState(mult, exp)
    	State.multiplier = mult
    	State.expiresAt  = exp
    	pushLocal()
    end
    
    local function persist()
    	if IS_STUDIO then return end
    	local ok, err = pcall(function()
    		LUCK_DS:SetAsync("state", { multiplier = State.multiplier, expiresAt = State.expiresAt })
    	end)
    	if not ok then warn("[Luck] Persist failed:", err) end
    end
    
    local function publish()
    	if IS_STUDIO then return end
    	local ok, err = pcall(function()
    		MessagingService:PublishAsync(LUCK_TOPIC, {
    			multiplier = State.multiplier,
    			expiresAt  = State.expiresAt,
    			t          = now(),
    		})
    	end)
    	if not ok then warn("[Luck] Publish failed:", err) end
    end
    
    local function load()
    	if IS_STUDIO then
    		applyState(DEFAULT_MULT, 0)
    		return
    	end
    	local ok, data = pcall(function() return LUCK_DS:GetAsync("state") end)
    	if ok and typeof(data) == "table" then
    		applyState(tonumber(data.multiplier) or DEFAULT_MULT, tonumber(data.expiresAt) or 0)
    	else
    		applyState(DEFAULT_MULT, 0)
    	end
    end
    
    local function subscribe()
    	if IS_STUDIO then return end
    	local ok, sub = pcall(function()
    		return MessagingService:SubscribeAsync(LUCK_TOPIC, function(msg)
    			local d = msg.Data
    			if typeof(d) ~= "table" then return end
    			if typeof(d.multiplier) ~= "number" or typeof(d.expiresAt) ~= "number" then return end
    			applyState(d.multiplier, d.expiresAt)
    		end)
    	end)
    	if not ok then warn("[Luck] Subscribe failed:", sub) end
    end
    
    local M = {}
    
    function M.Init()
    	load()
    	subscribe()
    end
    
    function M.OnChanged(cb)
    	table.insert(Subscribers, cb)
    	task.defer(cb, State.multiplier, secondsRemaining())
    end
    
    function M.Get()
    	return State.multiplier, secondsRemaining()
    end
    
    function M.DoubleAndReset()
    	local newMult = math.clamp(State.multiplier * 2, 1, 2^30)
    	local newExp  = now() + DURATION_SECS
    	applyState(newMult, newExp)
    	persist()
    	publish()
    end
    
    function M.Tick()
    	if secondsRemaining() <= 0 and State.multiplier ~= DEFAULT_MULT then
    		applyState(DEFAULT_MULT, 0)
    		persist()
    		publish()
    	end
    end
    
    return M

    Testing Checklist

    • Press F2 to open/close the panel
    • Send a global message (toast shows on screen)
    • Toggle Fly, Invisible, Invincible
    • Activate Server Luck ×2 and watch the HUD timer
    • Target by partial player name
    • Confirm the Admin page scrolls fully

    Important: Live servers handle DataStores differently. Always test publish/subscribe when you’re serious about how to make admin panel roblox studio.

    Restricting Access

    Add a simple whitelist in the server script:

    local ADMIN_USERIDS = { [123456789]=true, [987654321]=true }
    -- before executing actions:
    -- if not ADMIN_USERIDS[player.UserId] then return end

    © 2025 Roblox Tutorial — Learn how to make admin panel roblox studio and more.




  • Plants vs Brainrot Codes (September 2025) — All Working & How to Redeem







    Plants vs Brainrot Codes (September 2025) — All Working & How to Redeem















    Roblox Codes

    Plants vs Brainrot Codes — All Working Codes & How to Redeem

    Plants vs Brainrot codes list and how to redeem codes in Plants vs Brainrots
    Updated: 26 September 2025 — save time with quick copy buttons.

    Plants vs Brainrots is a Roblox tycoon that mashes up Grow a Garden and Steal a Brainrot into a PvZ-style defense game. Grow plants, let them defend your garden, and place defeated brainrot characters to earn cash. If you’re short on funds, use these Plants vs Brainrot codes to grab free items and money.

    All working Plants vs Brainrot codes

    Here are all the working codes as of 26 September 2025. Codes can expire at any time—redeem ASAP.

    Code Reward Copy
    STACKS 1 × Lucky Potion
    frozen 1 × Frost Grenade
    based $5,000 cash

    Tip: Some codes are case-sensitive. Try typing exactly as shown.

    How do I redeem codes in Plants vs Brainrots?

    1. Launch Plants vs Brainrots in Roblox.
    2. Open the in-game Codes menu/button.
    3. Paste a working code from this page and press Redeem.
    4. Enjoy your reward—cash or items are added instantly if the code is valid.

    If a code says “invalid,” it may be expired or you may have redeemed it already.

    Official sources:
    Yo Gurt Studio Discord (codes) ·
    Roblox

    All expired Plants vs Brainrot codes

    No expired codes listed yet. If one of the codes above stops working, we’ll move it here.

    Plants vs Brainrot codes — FAQ

    How often do new codes drop?

    Yo Gurt Studio posts new codes occasionally, usually after updates or milestones. Check the Discord and revisit this page.

    Why isn’t my code working?

    Common reasons: expired code, already redeemed, or capitalization mismatch. Try copying with the button and pasting in-game.




  • How to Make Settings in Roblox Studio (Copy & Paste)







    How to Make Settings in Roblox Studio (Copy & Paste)















    Roblox Studio • UI & UX

    How to Make Settings in Roblox Studio (Copy & Paste)

    How to make settings in Roblox Studio with a gear button and three toggles
    Right-side gear button opens a client-only settings panel: brightness, saturation, and low graphics.

    Follow this quick guide on how to make settings in Roblox Studio. Drop a single LocalScript in
    StarterPlayer ▸ StarterPlayerScripts to get a right-side gear button and a clean panel with three client-only toggles:
    high brightness, high saturation, and a low graphics mode. Copy the exact code below.

    On this page

    Create and place the LocalScript

    In Explorer, go to StarterPlayer ▸ StarterPlayerScripts, insert a LocalScript, and name it
    SettingsUI. Then paste the code from the next section. Everything runs client-only and doesn’t affect the server.

    Useful references:
    Client & Server model ·
    LocalScript

    SettingsUI — exact code (copy & paste)

    Click “Copy code” to grab the script exactly as-is (gear icon included).

    lua — StarterPlayer ▸ StarterPlayerScripts ▸ SettingsUI (LocalScript)
    --[[
    =====================================================================
    SettingsUI (LocalScript) — drop into StarterPlayerScripts
    ---------------------------------------------------------------------
    Features
    - Right-side square "gear" button (rounded, bordered) to open the panel
    - Settings panel with three toggles:
        1) High Brightness
        2) High Saturation
        3) Low Graphics Mode (disable fancy visuals client-side)
    - All effects are per-player (client only)
    - Script is split into clear sections with explanations
    =====================================================================
    ]]
    
    -- ========== [ Services ] ==========
    local Players      = game:GetService("Players")
    local TweenService = game:GetService("TweenService")
    local UserInput    = game:GetService("UserInputService")
    local Lighting     = game:GetService("Lighting")
    local Workspace    = game:GetService("Workspace")
    
    local player    = Players.LocalPlayer
    local playerGui = player:WaitForChild("PlayerGui")
    
    -- ================================================================
    -- [ SECTION 1 ]  Color Correction Utilities
    -- ================================================================
    local function ensureColorCorrection()
        local cc = Lighting:FindFirstChild("SettingsUI_ColorCorrection")
        if not cc then
            cc = Instance.new("ColorCorrectionEffect")
            cc.Name = "SettingsUI_ColorCorrection"
            cc.Parent = Lighting
            cc.Brightness = 0
            cc.Saturation = 0
            cc.Contrast   = 0
        end
        return cc
    end
    local CC = ensureColorCorrection()
    
    -- ================================================================
    -- [ SECTION 2 ]  LOW GRAPHICS MODE
    -- ================================================================
    local lowGfx = {
        surfaceParents = {}, -- [SurfaceAppearance] = original Parent
        decals        = {},  -- [Decal/Texture] = original Transparency
        partsEnabled  = {},  -- [ParticleEmitter/Trail/Beam] = original Enabled
        postEnabled   = {},  -- [Bloom/DOF/SunRays] = original Enabled
        atmo          = nil, -- {ref = Atmosphere, Density = x, Haze = y}
        _cached       = false,
        active        = false,
    }
    
    local function enumerateWorldOnce()
        if lowGfx._cached then return end
    
        for _, inst in ipairs(Workspace:GetDescendants()) do
            if inst:IsA("SurfaceAppearance") then
                lowGfx.surfaceParents[inst] = inst.Parent
            elseif inst:IsA("Decal") or inst:IsA("Texture") then
                lowGfx.decals[inst] = inst.Transparency
            elseif inst:IsA("ParticleEmitter") or inst:IsA("Trail") or inst:IsA("Beam") then
                lowGfx.partsEnabled[inst] = inst.Enabled
            end
        end
    
        for _, eff in ipairs(Lighting:GetChildren()) do
            if eff:IsA("BloomEffect") or eff:IsA("DepthOfFieldEffect") or eff:IsA("SunRaysEffect") then
                lowGfx.postEnabled[eff] = eff.Enabled
            end
        end
    
        local atmo = Lighting:FindFirstChildOfClass("Atmosphere")
        if atmo then
            lowGfx.atmo = { ref = atmo, Density = atmo.Density, Haze = atmo.Haze }
        end
    
        lowGfx._cached = true
    end
    
    local function setLowGraphics(on)
        enumerateWorldOnce()
    
        if on then
            for sa in pairs(lowGfx.surfaceParents) do
                if sa and sa.Parent ~= nil then sa.Parent = nil end
            end
            for d in pairs(lowGfx.decals) do
                if d and d.Parent then d.Transparency = 1 end
            end
            for p in pairs(lowGfx.partsEnabled) do
                if p and p.Parent then p.Enabled = false end
            end
            for eff in pairs(lowGfx.postEnabled) do
                if eff and eff.Parent then eff.Enabled = false end
            end
            if lowGfx.atmo and lowGfx.atmo.ref then
                local a = lowGfx.atmo.ref
                a.Density = 0
                a.Haze    = 0
            end
        else
            for sa, parent in pairs(lowGfx.surfaceParents) do
                if sa and parent and parent.Parent ~= nil then
                    sa.Parent = parent
                end
            end
            for d, was in pairs(lowGfx.decals) do
                if d and d.Parent then d.Transparency = was end
            end
            for p, was in pairs(lowGfx.partsEnabled) do
                if p and p.Parent then p.Enabled = was end
            end
            for eff, was in pairs(lowGfx.postEnabled) do
                if eff and eff.Parent then eff.Enabled = was end
            end
            if lowGfx.atmo and lowGfx.atmo.ref then
                local a = lowGfx.atmo.ref
                a.Density = lowGfx.atmo.Density
                a.Haze    = lowGfx.atmo.Haze
            end
        end
    
        lowGfx.active = on
    end
    
    -- ================================================================
    -- [ SECTION 3 ]  UI: Right-side Gear Button + Settings Panel
    -- ================================================================
    local gui = Instance.new("ScreenGui")
    gui.Name = "SettingsUI"
    gui.IgnoreGuiInset = true
    gui.ResetOnSpawn = false
    gui.DisplayOrder = 500
    gui.Parent = playerGui
    
    -- Right-side gear button (square, rounded, bordered)
    local GEAR_SIZE = 72
    local gearBtn = Instance.new("TextButton")
    gearBtn.Name = "GearButton"
    gearBtn.Size = UDim2.new(0, GEAR_SIZE, 0, GEAR_SIZE)
    gearBtn.Position = UDim2.new(1, -(GEAR_SIZE + 12), 0.5, -(GEAR_SIZE // 2))
    gearBtn.Text = "⚙"
    gearBtn.TextScaled = true
    gearBtn.Font = Enum.Font.GothamBold
    gearBtn.TextColor3 = Color3.fromRGB(230, 235, 240)
    gearBtn.BackgroundColor3 = Color3.fromRGB(32, 36, 42)
    gearBtn.AutoButtonColor = true
    gearBtn.Parent = gui
    do
        local c = Instance.new("UICorner"); c.CornerRadius = UDim.new(0, 14); c.Parent = gearBtn
        local s = Instance.new("UIStroke"); s.Thickness = 2; s.Color = Color3.fromRGB(22, 24, 28); s.ApplyStrokeMode = Enum.ApplyStrokeMode.Border; s.Parent = gearBtn
    end
    
    -- Settings Panel (slides in from right near the gear)
    local panel = Instance.new("Frame")
    panel.Name = "Panel"
    panel.Size = UDim2.new(0, 320, 0, 220)
    panel.Position = UDim2.new(1, 24, 0.5, -110) -- start off-screen to the right
    panel.BackgroundColor3 = Color3.fromRGB(22, 24, 28)
    panel.BackgroundTransparency = 0.05
    panel.Parent = gui
    do
        local c = Instance.new("UICorner"); c.CornerRadius = UDim.new(0, 14); c.Parent = panel
        local s = Instance.new("UIStroke"); s.Thickness = 2; s.Color = Color3.fromRGB(18, 20, 23); s.Parent = panel
    end
    
    local header = Instance.new("TextLabel")
    header.BackgroundTransparency = 1
    header.Size = UDim2.new(1, -44, 0, 40)
    header.Position = UDim2.new(0, 14, 0, 8)
    header.Text = "Settings"
    header.TextScaled = true
    header.Font = Enum.Font.GothamBold
    header.TextXAlignment = Enum.TextXAlignment.Left
    header.TextColor3 = Color3.new(1,1,1)
    header.Parent = panel
    
    local closeX = Instance.new("TextButton")
    closeX.Size = UDim2.new(0, 36, 0, 36)
    closeX.Position = UDim2.new(1, -44, 0, 8)
    closeX.Text = "X"
    closeX.TextScaled = true
    closeX.Font = Enum.Font.GothamBold
    closeX.TextColor3 = Color3.new(1,1,1)
    closeX.BackgroundColor3 = Color3.fromRGB(140, 50, 50)
    closeX.Parent = panel
    do local c = Instance.new("UICorner"); c.CornerRadius = UDim.new(0, 10); c.Parent = closeX end
    
    -- ================================================================
    -- [ SECTION 4 ]  Toggle Factory
    -- ================================================================
    local function makeToggle(labelText, yOffset, color, initial, onChange)
        local btn = Instance.new("TextButton")
        btn.Name = labelText
        btn.Size = UDim2.new(1, -28, 0, 44)
        btn.Position = UDim2.new(0, 14, 0, yOffset)
        btn.BackgroundColor3 = color
        btn.TextColor3 = Color3.new(1,1,1)
        btn.Font = Enum.Font.GothamBold
        btn.TextScaled = true
        btn.AutoButtonColor = true
        btn.Parent = panel
        do local c = Instance.new("UICorner"); c.CornerRadius = UDim.new(0, 10); c.Parent = btn end
    
        local state = initial
        local function refresh()
            btn.Text = (state and "ON  " or "OFF ") .. "— " .. labelText
            btn.BackgroundTransparency = state and 0 or 0.35
        end
        refresh()
    
        btn.MouseButton1Click:Connect(function()
            state = not state
            refresh()
            onChange(state)
        end)
    
        return {
            set = function(v) state = v; refresh(); onChange(state) end,
            get = function() return state end,
        }
    end
    
    -- ================================================================
    -- [ SECTION 5 ]  Create the Three Toggles
    -- ================================================================
    local brightToggle = makeToggle("High Brightness", 58, Color3.fromRGB(70, 130, 240), false, function(on)
        CC.Brightness = on and 0.25 or 0
    end)
    
    local saturToggle = makeToggle("High Saturation", 110, Color3.fromRGB(240, 160, 70), false, function(on)
        CC.Saturation = on and 0.35 or 0
    end)
    
    local lowGfxToggle = makeToggle("Low Graphics Mode", 162, Color3.fromRGB(90, 170, 90), false, function(on)
        setLowGraphics(on)
    end)
    
    -- ================================================================
    -- [ SECTION 6 ]  Open/Close Animations and Input
    -- ================================================================
    local function openPanel()
        TweenService:Create(panel, TweenInfo.new(0.22, Enum.EasingStyle.Quad, Enum.EasingDirection.Out),
            { Position = UDim2.new(1, -340, 0.5, -110) }):Play()
    end
    local function closePanel()
        TweenService:Create(panel, TweenInfo.new(0.22, Enum.EasingStyle.Quad, Enum.EasingDirection.In),
            { Position = UDim2.new(1, 24, 0.5, -110) }):Play()
    end
    
    gearBtn.MouseButton1Click:Connect(openPanel)
    closeX.MouseButton1Click:Connect(closePanel)
    
    -- Optional dev shortcut: F7 toggles the panel
    UserInput.InputBegan:Connect(function(input, gpe)
        if gpe then return end
        if input.KeyCode == Enum.KeyCode.F7 then
            if panel.Position.X.Offset > 0 then openPanel() else closePanel() end
        end
    end)

    Why this approach works

    Everything is client-only, perfect when you’re learning how to make settings in Roblox Studio.
    Visual effects use a single ColorCorrectionEffect; performance comes from temporarily disabling costly visuals and restoring them cleanly.

    More reading:
    ColorCorrectionEffect ·
    Atmosphere ·
    Roblox publishing checklist (example)