0% found this document useful (0 votes)
55 views52 pages

Message

The document outlines a Lua script for a restricted admin GUI in Roblox, designed to manage player bans while adhering to Roblox's Terms of Service. It includes functionality for loading and saving permanent and timed bans, as well as a user interface for authorized players to interact with. The script features in-memory ban lists, player search capabilities, and an admin panel that is only accessible to specific usernames.

Uploaded by

rayffan.fp22
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views52 pages

Message

The document outlines a Lua script for a restricted admin GUI in Roblox, designed to manage player bans while adhering to Roblox's Terms of Service. It includes functionality for loading and saving permanent and timed bans, as well as a user interface for authorized players to interact with. The script features in-memory ban lists, player search capabilities, and an admin panel that is only accessible to specific usernames.

Uploaded by

rayffan.fp22
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

-- RestrictedAdminGUI.

lua
-- A ModuleScript with admin panel restricted to specific usernames that follows
Roblox TOS
-- Adapted Ban Logic based on BanIt by Ty_Scripts

local Players = game:GetService("Players")


local DataStoreService = game:GetService("DataStoreService")
local MessagingService = game:GetService("MessagingService")
local RunService = game:GetService("RunService")
local HttpService = game:GetService("HttpService")

--[[ Old DataStore - Can be removed later


local BanStore = DataStoreService:GetDataStore("AdminGUITempBans")
]]

-- New DataStores based on BanIt approach


local permanentBanStore = DataStoreService:GetDataStore("CoreSigmaGlobalBans")
local timedBanStore = DataStoreService:GetDataStore("CoreSigmaTimedBans")

local BAN_MESSAGE_TOPIC = "CoreSigmaBanNotification_V2" -- Topic for


MessagingService (Changed to avoid conflicts)

local RestrictedAdminGUI = {}

-- In-memory ban lists (Adapted BanIt Style)


local loadedGlobalBans = {} -- Array of UserIDs: { 12345, 67890, ... }
local loadedTimedBans = {} -- Dictionary: { ["userIdString"] =
"timestamp;duration", ... }

-- Function to load permanent bans (as an array)


local function loadGlobalBans()
local success, data = xpcall(function()
return permanentBanStore:GetAsync("GlobalBans") -- Expecting an array
end, function(err)
warn("[CORE SIGMA] Failed to load global bans: " .. tostring(err))
return nil
end)
if success and typeof(data) == "table" then
-- Ensure it's treated as an array, even if loaded empty
loadedGlobalBans = data
local count = 0
-- Check if it looks like an array (numeric indices)
if #data > 0 or next(data) == nil then
loadedGlobalBans = data
count = #loadedGlobalBans
else
-- It might be an old dictionary format, try converting or reset
warn("[CORE SIGMA] GlobalBans data might be in old format.
Resetting to empty array.")
loadedGlobalBans = {}
end
print("[CORE SIGMA] Loaded", count, "global bans.")
else
loadedGlobalBans = {} -- Initialize as empty array if load fails or no
data
print("[CORE SIGMA] Initialized empty global ban list.")
end
end
-- Function to load timed bans (as a dictionary {userIdString =
"timestamp;duration"})
local function loadTimedBans()
local success, data = xpcall(function()
return timedBanStore:GetAsync("TimedBans") -- Expecting a dictionary
end, function(err)
warn("[CORE SIGMA] Failed to load timed bans: " .. tostring(err))
return nil
end)
if success and typeof(data) == "table" then
loadedTimedBans = data
local count = 0
for _ in pairs(loadedTimedBans) do count = count + 1 end
print("[CORE SIGMA] Loaded", count, "timed bans.")
else
loadedTimedBans = {} -- Initialize as empty dictionary if load fails or
no data
print("[CORE SIGMA] Initialized empty timed ban dictionary.")
end
end

-- Function to save permanent bans (as an array)


local function saveGlobalBans()
local success, err = xpcall(function()
permanentBanStore:SetAsync("GlobalBans", loadedGlobalBans)
print("[CORE SIGMA] Saved global bans.")
end, function(err)
warn("[CORE SIGMA] Failed to save global bans: " .. tostring(err))
end)
return success
end

-- Function to save timed bans (as a dictionary)


local function saveTimedBans()
local success, err = xpcall(function()
timedBanStore:SetAsync("TimedBans", loadedTimedBans)
print("[CORE SIGMA] Saved timed bans.")
end, function(err)
warn("[CORE SIGMA] Failed to save timed bans: " .. tostring(err))
end)
return success
end

-- Load initial data when script runs


loadGlobalBans()
loadTimedBans()

--[[ PlayerAdded connection moved inside checkBan logic for clarity


[Link]:Connect(function(player)
[Link](1)
if RunService:IsStudio() then
print([Link]("[CORE SIGMA Module] Checking ban for %s (%d) on
PlayerAdded", [Link], [Link]))
end
local isBanned = [Link](player)
if RunService:IsStudio() then
print([Link]("[CORE SIGMA Module] Ban check result for %s: %s",
[Link], tostring(isBanned)))
end
end)
]]

if RunService:IsStudio() then
print("[CORE SIGMA Module] Ban check will occur via [Link] in a
separate script calling checkBan.")
end

-- Allowed usernames (MUST BE ALL LOWERCASE)


local allowedUsers = {
"purezanaje",
"jedilnwza",
"altaccountidontcarel"
}

-- Helper function to find a player by partial name (case-insensitive)


function [Link](partialName)
local lowerPartialName = partialName:lower()
local foundPlayer = nil
local potentialMatches = {}
local exactMatch = nil

-- Debug info for Studio testing


if RunService:IsStudio() then
print("Finding player with name: " .. partialName)
print("Current players in game:")
for _, p in pairs(Players:GetPlayers()) do
print(" - " .. [Link] .. " (DisplayName: " .. [Link] ..
")")
end
end

-- First try exact matches (case insensitive)


for _, player in pairs(Players:GetPlayers()) do
local lowerName = [Link]:lower()
local lowerDisplayName = [Link]:lower()

if lowerName == lowerPartialName or lowerDisplayName ==


lowerPartialName then
exactMatch = player
break -- Exit loop as we found an exact match
end
end

-- Return exact match if found


if exactMatch then
return exactMatch
end

-- If no exact match, try partial matches


for _, player in pairs(Players:GetPlayers()) do
local lowerName = [Link]:lower()
local lowerDisplayName = [Link]:lower()

-- Check for substring match


if [Link](lowerName, lowerPartialName) or
[Link](lowerDisplayName, lowerPartialName) then
[Link](potentialMatches, player)
end
end

if #potentialMatches == 1 then
return potentialMatches[1] -- Only one partial match found
elseif #potentialMatches > 1 then
return potentialMatches -- Return table of multiple matches
end

return nil -- No player found


end

-- Create an alternative entry point with an obscure name


function [Link](usernameOrPlayer)
return [Link](usernameOrPlayer)
end

-- Function to create and display the admin GUI


function [Link](usernameOrPlayer)
local player
local username

if typeof(usernameOrPlayer) == "Instance" and usernameOrPlayer:IsA("Player")


then
player = usernameOrPlayer
username = [Link]
elseif typeof(usernameOrPlayer) == "string" then
username = usernameOrPlayer
player = Players:FindFirstChild(username)
if not player then
-- Don't log this to avoid revealing the script
return -- Cannot open panel if player doesn't exist
end
else
-- Don't log this to avoid revealing the script
return
end

-- Special case for known admin with capitalization issues (if your username
is AltAccountIdontcareL)
if username:lower() == "altaccountidontcarel" then
-- Debug info for Studio testing
if RunService:IsStudio() then
print("Special case handling for AltAccountIdontcareL")
end
-- Continue with admin access
-- Check authorization - silently fail for non-whitelisted users
elseif not [Link](allowedUsers, username:lower()) then
-- Debug info for Studio testing
if RunService:IsStudio() then
print("Access denied for user: " .. username)
print("Allowed users:")
for i, allowedUser in ipairs(allowedUsers) do
print(" " .. i .. ": " .. allowedUser)
end
print("Checking if '" .. username:lower() .. "' is in the list.")
end

-- For non-whitelisted users, we do something subtle that doesn't


reveal the admin system
[Link](player)
return
end

-- Debug info when allowed


if RunService:IsStudio() then
print("Access granted for user: " .. username)
end

-- Remove existing panel if any


local existingPanel = [Link]:FindFirstChild("CoreSigmaPanel")
if existingPanel then
existingPanel:Destroy()
end

-- Create ScreenGUI
local screenGui = [Link]("ScreenGui")
[Link] = "CoreSigmaPanel"
[Link] = false
[Link] = [Link]

-- Create Main Frame


local frame = [Link]("Frame")
[Link] = [Link](0, 480, 0, 600) -- Increased height by 80 pixels
[Link] = [Link](0.5, -240, 0.5, -300) -- Adjust position to
compensate for increased height
frame.BackgroundColor3 = [Link](25, 25, 30)
[Link] = 0
[Link] = screenGui
[Link] = true -- Required for dragging
[Link] = true -- Make draggable

-- Add rounded corners


local cornerRadius = [Link]("UICorner")
[Link] = [Link](0, 10)
[Link] = frame

-- Add subtle shadow effect


local shadow = [Link]("ImageLabel")
[Link] = [Link](0.5, 0.5)
[Link] = 1
[Link] = [Link](0.5, 0, 0.5, 0)
[Link] = [Link](1, 30, 1, 30)
[Link] = -1
[Link] = "rbxassetid://6014261993"
shadow.ImageColor3 = [Link](0, 0, 0)
[Link] = 0.5
[Link] = [Link]
[Link] = [Link](49, 49, 450, 450)
[Link] = frame

-- Create gradient background


local gradient = [Link]("UIGradient")
[Link] = [Link]({
[Link](0, [Link](35, 35, 40)),
[Link](1, [Link](20, 20, 25))
})
[Link] = 45
[Link] = frame
-- Title with red gradient background
local titleFrame = [Link]("Frame")
[Link] = [Link](1, 0, 0, 45)
[Link] = [Link](0, 0, 0, 0)
titleFrame.BackgroundColor3 = [Link](180, 30, 30)
[Link] = 0
[Link] = frame

local titleGradient = [Link]("UIGradient")


[Link] = [Link]({
[Link](0, [Link](220, 40, 40)),
[Link](1, [Link](160, 20, 20))
})
[Link] = 90
[Link] = titleFrame

local titleCorner = [Link]("UICorner")


[Link] = [Link](0, 10)
[Link] = titleFrame

-- Only round the top corners of the title bar


local titleFrameBottom = [Link]("Frame")
[Link] = [Link](1, 0, 0, 10)
[Link] = [Link](0, 0, 1, -10)
titleFrameBottom.BackgroundColor3 = [Link](180, 30, 30)
[Link] = 0
[Link] = titleFrame

-- Apply same gradient to bottom part


local bottomGradient = titleGradient:Clone()
[Link] = titleFrameBottom

-- Admin icon
local adminIcon = [Link]("ImageLabel")
[Link] = [Link](0, 24, 0, 24)
[Link] = [Link](0, 15, 0, 10)
[Link] = 1
[Link] = "rbxassetid://6026568245" -- Admin/shield icon
adminIcon.ImageColor3 = [Link](255, 255, 255)
[Link] = titleFrame

local titleLabel = [Link]("TextLabel")


[Link] = [Link](1, -90, 1, 0)
[Link] = [Link](0, 45, 0, 0)
[Link] = 1
titleLabel.TextColor3 = [Link](255, 255, 255)
[Link] = "CORE SKIBIDI SIGMA"
[Link] = 18
[Link] = [Link]
[Link] = [Link]
[Link] = titleFrame

-- Create a label for the player dropdown


local targetLabel = [Link]("TextLabel")
[Link] = [Link](0, 120, 0, 20)
[Link] = [Link](0, 55, 0, 55)
[Link] = 1
targetLabel.TextColor3 = [Link](200, 40, 40)
[Link] = "SELECT TARGET"
[Link] = 12
[Link] = [Link]
[Link] = [Link]
[Link] = 2
[Link] = frame

-- Player Dropdown Frame


local dropdownFrame = [Link]("Frame")
[Link] = "PlayerDropdown"
[Link] = [Link](0, 320, 0, 40)
[Link] = [Link](0.5, -160, 0, 60)
dropdownFrame.BackgroundColor3 = [Link](35, 35, 40)
[Link] = 0
[Link] = false -- Don't clip the dropdown
[Link] = 5
[Link] = frame

-- Add highlight border for dropdown


local dropdownStroke = [Link]("UIStroke")
[Link] = [Link](180, 30, 30)
[Link] = 1.5
[Link] = 0.5
[Link] = dropdownFrame

local dropdownCorner = [Link]("UICorner")


[Link] = [Link](0, 8)
[Link] = dropdownFrame

-- Selected Player Display


local selectedDisplay = [Link]("TextButton")
[Link] = "SelectedDisplay"
[Link] = [Link](1, 0, 1, 0)
[Link] = 1
[Link] = "Click to select a player"
selectedDisplay.TextColor3 = [Link](255, 255, 255)
[Link] = 14
[Link] = [Link]
[Link] = 6
[Link] = dropdownFrame

-- Dropdown Arrow Icon


local arrowIcon = [Link]("ImageLabel")
[Link] = [Link](0, 16, 0, 16)
[Link] = [Link](1, -26, 0.5, -8)
[Link] = 1
[Link] = "rbxassetid://6031091004" -- Dropdown arrow icon
arrowIcon.ImageColor3 = [Link](255, 255, 255)
[Link] = 6
[Link] = dropdownFrame

-- Dropdown Content Frame (Hidden initially) - Add to screenGui instead of


dropdownFrame for better visibility
local dropdownContent = [Link]("Frame")
[Link] = "DropdownContent"
[Link] = [Link](0, 320, 0, 200) -- Scrollable area for
options
[Link] = [Link](0.5, -160, 0, 105) -- Position it just
below the dropdown
dropdownContent.BackgroundColor3 = [Link](35, 35, 40)
[Link] = 0
[Link] = false
[Link] = 50 -- Much higher ZIndex to ensure it appears on top
[Link] = frame -- Attach to main frame, not dropdown frame

local contentCorner = [Link]("UICorner")


[Link] = [Link](0, 8)
[Link] = dropdownContent

local contentStroke = [Link]("UIStroke")


[Link] = [Link](180, 30, 30)
[Link] = 1.5
[Link] = 0.5
[Link] = dropdownContent

-- ScrollingFrame for player list


local scrollFrame = [Link]("ScrollingFrame")
[Link] = [Link](1, -10, 1, -10)
[Link] = [Link](0, 5, 0, 5)
[Link] = 1
[Link] = 0
[Link] = 4
scrollFrame.ScrollBarImageColor3 = [Link](180, 30, 30)
[Link] = 51 -- Even higher ZIndex
[Link] = dropdownContent

-- List layout for player options


local listLayout = [Link]("UIListLayout")
[Link] = [Link](0, 2)
[Link] = [Link]
[Link] = scrollFrame

-- Function to refresh player list


local function refreshPlayerList()
-- Clear existing buttons
for _, child in pairs(scrollFrame:GetChildren()) do
if child:IsA("TextButton") or child:IsA("TextLabel") then
child:Destroy()
end
end

-- Get current player list


local players = Players:GetPlayers()

-- Update scroll frame canvas size based on player count


local contentHeight = [Link](#players * 32 + 10, 50) -- Minimum 50
pixels height
[Link] = [Link](0, 0, 0, contentHeight)

-- Add player buttons


for i, plr in pairs(players) do
local playerButton = [Link]("TextButton")
[Link] = [Link](0.95, 0, 0, 30)
playerButton.BackgroundColor3 = [Link](40, 40, 45)
[Link] = 0
[Link] = [Link]
playerButton.TextColor3 = [Link](255, 255, 255)
[Link] = 14
[Link] = [Link]
[Link] = 52
[Link] = scrollFrame

-- Add rounded corners


local btnCorner = [Link]("UICorner")
[Link] = [Link](0, 6)
[Link] = playerButton

-- Hover effect
[Link]:Connect(function()
playerButton.BackgroundColor3 = [Link](180, 30, 30)
end)

[Link]:Connect(function()
playerButton.BackgroundColor3 = [Link](40, 40, 45)
end)

-- Selection logic
playerButton.MouseButton1Click:Connect(function()
[Link] = [Link]
[Link] = false
[Link] = "Selected player: " .. [Link]

-- Rotate arrow back when closing dropdown


[Link] = 0
end)
end

if #players == 0 then
local noPlayersLabel = [Link]("TextLabel")
[Link] = [Link](0.95, 0, 0, 30)
noPlayersLabel.BackgroundColor3 = [Link](40, 40, 45)
[Link] = 0
[Link] = "No players found"
noPlayersLabel.TextColor3 = [Link](200, 200, 200)
[Link] = 14
[Link] = [Link]
[Link] = 52
[Link] = scrollFrame

local lblCorner = [Link]("UICorner")


[Link] = [Link](0, 6)
[Link] = noPlayersLabel
end
end

-- Toggle dropdown visibility


selectedDisplay.MouseButton1Click:Connect(function()
[Link] = not [Link]

-- Flip arrow icon when opening/closing


if [Link] then
[Link] = 180 -- Point up when open
refreshPlayerList()
else
[Link] = 0 -- Point down when closed
end
end)
-- Close dropdown when clicking elsewhere
[Link]:Connect(function(input)
if [Link] == [Link].MouseButton1 then
-- Get mouse position
local mouse = game:GetService("Players").LocalPlayer:GetMouse()
local mousePos = [Link](mouse.X, mouse.Y)

-- Check if click is outside dropdown


local dropdownAbsPos = [Link]
local dropdownAbsSize = [Link]
local dropdownBounds = [Link](
dropdownAbsPos.X,
dropdownAbsPos.Y,
dropdownAbsPos.X + dropdownAbsSize.X,
dropdownAbsPos.Y + dropdownAbsSize.Y
)

local contentAbsPos = [Link]


local contentAbsSize = [Link]
local contentBounds = [Link](
contentAbsPos.X,
contentAbsPos.Y,
contentAbsPos.X + contentAbsSize.X,
contentAbsPos.Y + contentAbsSize.Y
)

if not dropdownBounds:PointInRect(mousePos) and not


contentBounds:PointInRect(mousePos) and [Link] then
[Link] = false
[Link] = 0
end
end
end)

-- Refresh Button - Move to right side of dropdown title


local refreshButton = [Link]("TextButton")
[Link] = [Link](0, 30, 0, 30)
[Link] = [Link](0, 430, 0, 50) -- Position near title,
away from dropdown
refreshButton.BackgroundColor3 = [Link](40, 40, 45)
refreshButton.TextColor3 = [Link](255, 255, 255)
[Link] = "⟳" -- Refresh symbol
[Link] = 18
[Link] = [Link]
[Link] = frame

local refreshCorner = [Link]("UICorner")


[Link] = [Link](0, 6)
[Link] = refreshButton

local refreshStroke = [Link]("UIStroke")


[Link] = [Link](180, 30, 30)
[Link] = 1.5
[Link] = 0.5
[Link] = refreshButton

-- Refresh button hover effect


[Link]:Connect(function()
refreshButton.BackgroundColor3 = [Link](180, 30, 30)
end)

[Link]:Connect(function()
refreshButton.BackgroundColor3 = [Link](40, 40, 45)
end)

refreshButton.MouseButton1Click:Connect(function()
refreshPlayerList()
[Link] = "Player list refreshed"
end)

-- Reason Box with styling (moved down slightly)


local reasonBox = [Link]("TextBox")
[Link] = [Link](0, 360, 0, 60)
[Link] = [Link](0.5, -180, 0, 120)
[Link] = "Enter reason (optional for Kick/Ban All)"
[Link] = ""
reasonBox.BackgroundColor3 = [Link](35, 35, 40)
reasonBox.TextColor3 = [Link](255, 255, 255)
reasonBox.PlaceholderColor3 = [Link](180, 180, 180)
[Link] = true
[Link] = true
[Link] = [Link] -- Changed from Gotham to
better support UTF-8
[Link] = 14
[Link] = false
[Link] = 6 -- Ensure it's above other elements
[Link] = true
[Link] = frame

-- Add highlight border


local reasonBoxStroke = [Link]("UIStroke")
[Link] = [Link](180, 30, 30)
[Link] = 1.5
[Link] = 0.5
[Link] = reasonBox

local reasonBoxCorner = [Link]("UICorner")


[Link] = [Link](0, 8)
[Link] = reasonBox

local reasonBoxPadding = [Link]("UIPadding")


[Link] = [Link](0, 10)
[Link] = [Link](0, 5)
[Link] = reasonBox

-- Add visual feedback when the reason box is focused


[Link]:Connect(function()
if reasonBoxStroke then
[Link] = 2
[Link] = 0
[Link] = [Link](220, 50, 50)
end

-- Show developer debug in Studio


if RunService:IsStudio() and reasonBox and [Link] ~= nil then
print("Reason box focused. Current text: '" .. [Link] ..
"'")
end
end)

[Link]:Connect(function(enterPressed)
if reasonBoxStroke then
[Link] = 1.5
[Link] = 0.5
[Link] = [Link](180, 30, 30)
end

-- Debug info for Studio testing


if RunService:IsStudio() then
if reasonBox and [Link] ~= nil then
print("Reason box focus lost. Text content: '" ..
[Link] .. "'")
end
if currentReason then
print("Current reason variable: '" .. currentReason .. "'")
end
end
end)

-- Add a variable to track the current reason text


local currentReason = ""

-- Update the current reason immediately on creation with null check


if reasonBox and [Link] ~= nil then
currentReason = [Link]
end

-- Update the current reason when the text changes with null check
reasonBox:GetPropertyChangedSignal("Text"):Connect(function()
-- Update the tracking variable with the latest text
if reasonBox and [Link] ~= nil then
currentReason = [Link]

if RunService:IsStudio() then
-- Log the reason to check for encoding issues
local hexValue = ""
for i = 1, #currentReason do
local byte = [Link](currentReason:sub(i,i))
hexValue = hexValue .. [Link]("%02X ", byte)
end
print("Reason updated: '" .. currentReason .. "'")
print("Hex values: " .. hexValue)
end
end
end)

-- Create a label for the reason box with improved visibility


local reasonLabel = [Link]("TextLabel")
[Link] = [Link](0, 80, 0, 20)
[Link] = [Link](0, 65, 0, 115)
[Link] = 1
reasonLabel.TextColor3 = [Link](220, 60, 60)
[Link] = "REASON"
[Link] = 12
[Link] = [Link]
[Link] = [Link]
[Link] = 7
[Link] = frame

-- Create function for consistent button styling with red theme


local function createStyledButton(text, posX, posY, isWarning)
local baseColor = isWarning and [Link](180, 40, 40) or
[Link](120, 30, 30)

local button = [Link]("TextButton")


[Link] = [Link](0, 120, 0, 38)
[Link] = [Link](0.5, posX, 0, posY)
button.BackgroundColor3 = baseColor
button.TextColor3 = [Link](255, 255, 255)
[Link] = text
[Link] = [Link]
[Link] = 14
[Link] = false -- We'll handle hover effects manually
[Link] = frame

-- Add gradient
local buttonGradient = [Link]("UIGradient")
[Link] = [Link]({
[Link](0, [Link](baseColor.R * 1.2 *
255, baseColor.G * 1.2 * 255, baseColor.B * 1.2 * 255)),
[Link](1, baseColor)
})
[Link] = 90
[Link] = button

local buttonCorner = [Link]("UICorner")


[Link] = [Link](0, 8)
[Link] = button

-- Add subtle shadow/glow


local buttonStroke = [Link]("UIStroke")
[Link] = [Link](255, 100, 100)
[Link] = 1
[Link] = 0.7
[Link] = button

-- Add hover effect


local hoverGradient = [Link]({
[Link](0, [Link](baseColor.R * 1.4 *
255, baseColor.G * 1.4 * 255, baseColor.B * 1.4 * 255)),
[Link](1, [Link](baseColor.R * 1.2 *
255, baseColor.G * 1.2 * 255, baseColor.B * 1.2 * 255))
})

local normalGradient = [Link]

[Link]:Connect(function()
[Link] = hoverGradient
[Link] = 0.4
end)

[Link]:Connect(function()
[Link] = normalGradient
[Link] = 0.7
end)
return button
end

-- Divider line for visual separation


local divider = [Link]("Frame")
[Link] = [Link](0.9, 0, 0, 2)
[Link] = [Link](0.05, 0, 0, 190)
divider.BackgroundColor3 = [Link](180, 30, 30)
[Link] = 0
[Link] = frame

-- Add glow to divider


local dividerGradient = [Link]("UIGradient")
[Link] = [Link]({
[Link](0, 0.7),
[Link](0.5, 0),
[Link](1, 0.7)
})
[Link] = divider

-- Function to create a confirmation dialog


local function createConfirmationFrame(message)
local confirmationFrame = [Link]("Frame")
[Link] = [Link](0, 300, 0, 120)
[Link] = [Link](0.5, -150, 0.5, -60)
confirmationFrame.BackgroundColor3 = [Link](45, 45, 50)
[Link] = 0
[Link] = 100 -- Ensure it's on top
[Link] = frame -- Parent to main frame

local confirmCorner = [Link]("UICorner")


[Link] = [Link](0, 8)
[Link] = confirmationFrame

local confirmStroke = [Link]("UIStroke")


[Link] = [Link](200, 50, 50)
[Link] = 2
[Link] = confirmationFrame

local messageLabel = [Link]("TextLabel")


[Link] = [Link](1, -20, 0, 50)
[Link] = [Link](0, 10, 0, 10)
[Link] = 1
messageLabel.TextColor3 = [Link](230, 230, 230)
[Link] = message
[Link] = true
[Link] = 14
[Link] = [Link]
[Link] = confirmationFrame

local yesButton = [Link]("TextButton")


[Link] = "YesButton"
[Link] = [Link](0, 100, 0, 30)
[Link] = [Link](0.5, -110, 1, -40)
yesButton.BackgroundColor3 = [Link](80, 180, 80)
yesButton.TextColor3 = [Link](255, 255, 255)
[Link] = "Yes"
[Link] = [Link]
[Link] = 14
[Link] = confirmationFrame

local yesCorner = [Link]("UICorner")


[Link] = [Link](0, 6)
[Link] = yesButton

local noButton = [Link]("TextButton")


[Link] = "NoButton"
[Link] = [Link](0, 100, 0, 30)
[Link] = [Link](0.5, 10, 1, -40)
noButton.BackgroundColor3 = [Link](200, 60, 60)
noButton.TextColor3 = [Link](255, 255, 255)
[Link] = "No"
[Link] = [Link]
[Link] = 14
[Link] = confirmationFrame

local noCorner = [Link]("UICorner")


[Link] = [Link](0, 6)
[Link] = noButton

-- Simple hover effects


[Link]:Connect(function() yesButton.BackgroundColor3 =
[Link](100, 200, 100) end)
[Link]:Connect(function() yesButton.BackgroundColor3 =
[Link](80, 180, 80) end)
[Link]:Connect(function() noButton.BackgroundColor3 =
[Link](220, 80, 80) end)
[Link]:Connect(function() noButton.BackgroundColor3 =
[Link](200, 60, 60) end)

return confirmationFrame
end

-- Section Label - Individual Actions


local individualLabel = [Link]("TextLabel")
[Link] = [Link](0, 160, 0, 20)
[Link] = [Link](0, 30, 0, 200)
[Link] = 1
individualLabel.TextColor3 = [Link](220, 60, 60)
[Link] = "INDIVIDUAL ACTIONS"
[Link] = 13
[Link] = [Link]
[Link] = [Link]
[Link] = frame

-- Button creation for main actions


local kickButton = createStyledButton("KICK", -185, 230, false)
local warnButton = createStyledButton("WARN", -60, 230, false)
local banButton = createStyledButton("BAN", -60, 230, true)
local tempBanButton = createStyledButton("TEMP BAN", 65, 230, true)
local unbanButton = createStyledButton("UNBAN", 190, 230, false)
-- Adjust positions (Example: Move TempBan left, place Unban)
[Link] = [Link](0.5, 65, 275, true) -- Move Temp Ban down
and left slightly
[Link] = [Link](0.5, 190, 275, false) -- Move Unban down to
Row 2 Right
[Link] = [Link](0.5, -60, 275, true) -- Move Ban down to Row 2
Middle
[Link] = [Link](0.5, -185, 275, false) -- Move Warn down to
Row 2 Left
[Link] = [Link](0.5, -185, 230, false) -- Move Kick up to Row
1 Left

-- Create Server Ban Button


local serverBanButton = createStyledButton("SERVER BAN", -60, 230, true)
[Link] = [Link](0.5, -60, 230, true) -- Row 1 Middle

-- Create Server Unban Button


local serverUnbanButton = createStyledButton("SERVER UNBAN", 65, 230, false)
[Link] = [Link](0.5, 65, 230, false) -- Row 1 Right

-- Section Label - Mass Actions


local massLabel = [Link]("TextLabel")
[Link] = [Link](0, 100, 0, 20)
[Link] = [Link](0, 30, 325) -- Adjusted Y Position
[Link] = 1
massLabel.TextColor3 = [Link](200, 40, 40)
[Link] = "MASS ACTIONS"
[Link] = 12
[Link] = [Link]
[Link] = [Link]
[Link] = 2
[Link] = frame

-- Action Buttons (Row 3 - All)


local kickAllButton = createStyledButton("KICK ALL", -185, 355, true) --
Adjusted Y Position
local banAllButton = createStyledButton("BAN ALL", -60, 355, true) --
Adjusted Y Position
local tempBanAllButton = createStyledButton("TEMP BAN ALL", 65, 355, true) --
Adjusted Y Position
-- local unbanAllButton = createStyledButton("UNBAN ALL", 190, 355, false) --
Removed Unban All

-- Status Label with red highlight and background - Adjust Y position


local statusBackground = [Link]("Frame")
[Link] = [Link](0.95, 0, 0, 30)
[Link] = [Link](0.025, 0, 1, -80) -- Move slightly up
to make space for tabs
statusBackground.BackgroundColor3 = [Link](40, 40, 45)
[Link] = 0
[Link] = frame

local statusBgCorner = [Link]("UICorner")


[Link] = [Link](0, 6)
[Link] = statusBackground

local statusStroke = [Link]("UIStroke")


[Link] = [Link](180, 30, 30)
[Link] = 1
[Link] = 0.7
[Link] = statusBackground

local statusLabel = [Link]("TextLabel")


[Link] = [Link](1, -16, 1, 0)
[Link] = [Link](0, 8, 0, 0)
[Link] = 1
statusLabel.TextColor3 = [Link](220, 220, 220)
[Link] = "Ready"
[Link] = [Link]
[Link] = 14
[Link] = [Link]
[Link] = statusBackground

-- Close Button with red styling


local closeButton = [Link]("TextButton")
[Link] = [Link](0, 32, 0, 32)
[Link] = [Link](1, -40, 0, 6)
closeButton.BackgroundColor3 = [Link](220, 40, 40)
closeButton.TextColor3 = [Link](255, 255, 255)
[Link] = "×"
[Link] = 24
[Link] = [Link]
[Link] = titleFrame

local closeButtonCorner = [Link]("UICorner")


[Link] = [Link](1, 0)
[Link] = closeButton

-- Add hover effect for close button


[Link]:Connect(function()
closeButton.BackgroundColor3 = [Link](255, 60, 60)
end)

[Link]:Connect(function()
closeButton.BackgroundColor3 = [Link](220, 40, 40)
end)

-- Function to handle player finding result


local function handlePlayerResult(targetUsername, actionName, callback)
-- Debug info about the input
if RunService:IsStudio() then
print("handlePlayerResult called with username: '" ..
targetUsername .. "'")
print("Username length: " .. #targetUsername)
print("Username type: " .. typeof(targetUsername))
if #targetUsername > 0 then
print("First character code: " ..
[Link](targetUsername:sub(1,1)))
end
end

if targetUsername == nil then


[Link] = "Error: No username provided"
return
end

if typeof(targetUsername) ~= "string" then


[Link] = "Error: Invalid username type"
return
end

if targetUsername == "" then


[Link] = "Error: Please enter a target username."
return
end

-- Trim whitespace from input


targetUsername = targetUsername:gsub("^%s*(.-)%s*$", "%1")

-- Check again after trimming


if targetUsername == "" then
[Link] = "Error: Please enter a target username."
return
end

if #targetUsername < 2 then


[Link] = "Error: Username must be at least 2
characters."
return
end

-- Debug info for Studio


if RunService:IsStudio() then
print("Handling player result for: '" .. targetUsername .. "'")
end

-- Try exact match first with current players


local exactMatch = nil
for _, p in pairs(Players:GetPlayers()) do
if [Link]:lower() == targetUsername:lower() or
[Link]:lower() == targetUsername:lower() then
exactMatch = p
break
end
end

if exactMatch then
if RunService:IsStudio() then
print("Found exact match: " .. [Link])
end
callback(exactMatch)
return
end

-- If no exact match, try with findPlayer function


local result = [Link](targetUsername)

-- Debug the result


if RunService:IsStudio() then
if result == nil then
print("Result: Player not found")
elseif typeof(result) == "table" then
print("Result: Multiple matches found")
for i, p in ipairs(result) do
print(" " .. i .. ": " .. [Link])
end
elseif typeof(result) == "Instance" and result:IsA("Player") then
print("Result: Single player found - " .. [Link])
else
print("Result: Unexpected type - " .. typeof(result))
end
end
if result == nil then
-- List current players in the error message to help user
local playerList = {}
for _, p in pairs(Players:GetPlayers()) do
[Link](playerList, [Link])
end

if #playerList > 0 then


[Link] = "Error: Player not found: '" ..
targetUsername .. "'. Current players: " .. [Link](playerList, ", ")
else
[Link] = "Error: Player not found: '" ..
targetUsername .. "'. No players in game."
end
elseif typeof(result) == "table" then
local names = {}
for _, p in ipairs(result) do [Link](names, [Link]) end
[Link] = "Error: Multiple matches found: " ..
[Link](names, ", ") .. ". Be more specific."
elseif typeof(result) == "Instance" and result:IsA("Player") then
callback(result)
else
[Link] = "Error: Unexpected result finding player."
end
end

-- Enhanced kick function for more reliable kicking


function [Link](player, reason)
-- Use a simpler, direct kick method
local success, errorMsg = pcall(function()
if player and [Link] then -- Check if player is still
valid
player:Kick(reason or "You have been removed by the Core
Sigma.")
else
-- Player might have left already or is invalid
errorMsg = "Player object is invalid or has no parent." --
Set error message for logging
success = false -- Indicate failure
end
end)

-- Only log errors for whitelisted users in Studio


if not success then
if RunService:IsStudio() then
warn([Link]("Error kicking player %s: %s", player
and [Link] or "Unknown", tostring(errorMsg)))
end
-- Optionally, update the status label if available (might need
context passing)
-- [Link] = "Error kicking " .. (player and [Link]
or "player")
end
end

-- Kick button functionality


kickButton.MouseButton1Click:Connect(function()
-- Get player from dropdown selection
local targetUsername = [Link]
if RunService:IsStudio() then
print("[Kick Button Clicked] Selected player: '" ..
targetUsername .. "'")
end

if targetUsername == "Click to select a player" then


[Link] = "Error: Please select a player first"
showAnimation(frame, "Please select a player!",
[Link](255, 0, 0))
return
end

-- Store original button color


local originalColor = kickButton.BackgroundColor3
kickButton.BackgroundColor3 = [Link](200, 20, 20)

-- Apply reason from tracked variable


local reason = currentReason ~= "" and currentReason or "Kicked by Core
Sigma" -- Updated default reason

[Link] = "Processing kick request..."

-- Debug output for Studio


if RunService:IsStudio() then
print("Kick requested for: '" .. targetUsername .. "' with
reason: '" .. reason .. "'")
end

-- Try to get player by exact name


local targetPlayer = Players:FindFirstChild(targetUsername)

if targetPlayer then
local success, errorMsg = pcall(function()
[Link](targetPlayer, reason)
end)

if success then
[Link] = "Successfully kicked " ..
[Link]
showAnimation(frame, "Successfully kicked " ..
[Link], [Link](20, 200, 20))
else
[Link] = "Error kicking " .. [Link] ..
": " .. tostring(errorMsg)
showAnimation(frame, "Error kicking player",
[Link](255, 0, 0))
if RunService:IsStudio() then
warn("Kick error: " .. tostring(errorMsg))
end
end

[Link]([Link], "kicked",
[Link], reason)
else
[Link] = "Error: Selected player no longer in game."
showAnimation(frame, "Selected player no longer in game",
[Link](255, 0, 0))
-- Refresh the player list
refreshPlayerList()
end

-- Reset button color


[Link](0.3)
kickButton.BackgroundColor3 = originalColor
end)

-- Warn button functionality


warnButton.MouseButton1Click:Connect(function()
-- Get player from dropdown selection
local targetUsername = [Link]
if RunService:IsStudio() then
print("[Warn Button Clicked] Selected player: '" ..
targetUsername .. "'")
end

if targetUsername == "Click to select a player" then


[Link] = "Error: Please select a player first"
return
end

-- Use the tracked currentReason variable instead of directly accessing


[Link]
local reason = currentReason ~= "" and currentReason or "Warning from
Core Sigma"

[Link] = "Processing warn request..."

-- Debug output for Studio


if RunService:IsStudio() then
print("Warn requested for: '" .. targetUsername .. "'")
print("Using reason: '" .. reason .. "'")
end

-- Try to get player by exact name


local targetPlayer = Players:FindFirstChild(targetUsername)

if targetPlayer then
local success, errorMsg = pcall(function()
[Link](targetPlayer, [Link],
reason)
end)

if success then
[Link] = "Successfully warned " ..
[Link]
else
[Link] = "Error warning " .. [Link] ..
": " .. tostring(errorMsg)
if RunService:IsStudio() then
warn("Warn error: " .. tostring(errorMsg))
end
end

[Link]([Link], "warned",
[Link], reason)
else
[Link] = "Error: Selected player no longer in game."
-- Refresh the player list
refreshPlayerList()
end
end)

-- Ban button functionality


banButton.MouseButton1Click:Connect(function()
-- Get player from dropdown selection
local targetUsername = [Link]
if RunService:IsStudio() then
print("[Ban Button Clicked] Selected player: '" .. targetUsername
.. "'")
end

if targetUsername == "Click to select a player" then


[Link] = "Error: Please select a player first"
showAnimation(frame, "Please select a player!",
[Link](255, 0, 0))
return
end

-- Store original button color


local originalColor = banButton.BackgroundColor3
banButton.BackgroundColor3 = [Link](200, 20, 20)

-- Apply reason from tracked variable


local reason = currentReason ~= "" and currentReason or "Banned by Core
Sigma"

[Link] = "Processing ban request..."

-- Debug output
if RunService:IsStudio() then
print("Ban requested for: '" .. targetUsername .. "' with reason:
'" .. reason .. "'")
end

local targetPlayer = Players:FindFirstChild(targetUsername)


local userId

if targetPlayer then
userId = [Link]
else
-- Try getting UserId even if player left
local success, foundUserId = pcall(function()
return Players:GetUserIdFromNameAsync(targetUsername)
end)
if success and foundUserId then
userId = foundUserId
if RunService:IsStudio() then
print("Got UserId from NameAsync for offline player:
" .. userId)
end
else
[Link] = "Error: Could not find player or UserId
for '" .. targetUsername .. "'"
showAnimation(frame, "Could not find player/UserId!",
[Link](255, 0, 0))
[Link](0.3)
banButton.BackgroundColor3 = originalColor
return
end
end

-- Ban logic using BanIt style (array)


if not [Link](loadedGlobalBans, userId) then
[Link](loadedGlobalBans, userId)
saveGlobalBans() -- Save immediately after adding

[Link] = "Successfully banned " .. targetUsername


showAnimation(frame, "Successfully banned " .. targetUsername,
[Link](20, 200, 20))
[Link]([Link], "banned",
targetUsername, reason)

-- Publish ban message for other servers (BanIt format)


pcall(function()
local messageData = [Link]("%dâ___%sâ___%d", userId,
reason, 0) -- Duration 0 for permanent
MessagingService:PublishAsync(BAN_MESSAGE_TOPIC,
messageData)
if RunService:IsStudio() then print("Published Ban Message:
" .. messageData) end
end)

-- Kick the player if they are still in the game


if targetPlayer and [Link] then
targetPlayer:Kick([Link]("You have been permanently
banned. Reason: %s", reason))
end

else
[Link] = targetUsername .. " is already banned
globally."
showAnimation(frame, targetUsername .. " is already banned!",
[Link](255, 150, 0))
end

-- Reset button color


[Link](0.3)
banButton.BackgroundColor3 = originalColor
end)

-- Temp Ban button functionality


tempBanButton.MouseButton1Click:Connect(function()
-- Get player from dropdown selection
local targetUsername = [Link]

if RunService:IsStudio() then
print("[Temp Ban Button Clicked] Selected player: '" ..
targetUsername .. "'")
end

if targetUsername == "Click to select a player" then


[Link] = "Error: Please select a player first"
showAnimation(frame, "Please select a player!",
[Link](255, 0, 0))
return
end
-- Store original button color
local originalColor = tempBanButton.BackgroundColor3
tempBanButton.BackgroundColor3 = [Link](200, 20, 20)

-- Apply reason and duration


local reason = currentReason ~= "" and currentReason or "Server Temp
Ban (1 Hour)"
local durationSeconds = 3600 -- Hardcoded 1 hour for now

[Link] = "Processing temp ban request..."

-- Debug output
if RunService:IsStudio() then
print("Temp ban requested for: '" .. targetUsername .. "' with
reason: '" .. reason .. "' for " .. durationSeconds .. "s")
end

local targetPlayer = Players:FindFirstChild(targetUsername)


local userId

if targetPlayer then
userId = [Link]
else
-- Try getting UserId even if player left
local success, foundUserId = pcall(function()
return Players:GetUserIdFromNameAsync(targetUsername)
end)
if success and foundUserId then
userId = foundUserId
if RunService:IsStudio() then
print("Got UserId from NameAsync for offline player:
" .. userId)
end
else
[Link] = "Error: Could not find player or UserId
for '" .. targetUsername .. "'"
showAnimation(frame, "Could not find player/UserId!",
[Link](255, 0, 0))
[Link](0.3)
tempBanButton.BackgroundColor3 = originalColor
return
end
end

local userIdStr = tostring(userId)


local banInfoString = [Link]("%d;%d", [Link](),
durationSeconds)

-- Ban logic using BanIt style (dictionary)


loadedTimedBans[userIdStr] = banInfoString
if saveTimedBans() then -- Save immediately
[Link] = "Successfully temp banned " ..
targetUsername .. " for 1 hour"
showAnimation(frame, "Successfully temp banned " ..
targetUsername, [Link](20, 200, 20))
[Link]([Link], "temp banned (1hr)",
targetUsername, reason)
-- Publish ban message for other servers (BanIt format)
pcall(function()
local messageData = [Link]("%dâ___%sâ___%d", userId,
reason, durationSeconds)
MessagingService:PublishAsync(BAN_MESSAGE_TOPIC,
messageData)
if RunService:IsStudio() then print("Published Temp Ban
Message: " .. messageData) end
end)

-- Kick the player locally if they are still in the game


if targetPlayer and [Link] then
targetPlayer:Kick([Link]("You have been temporarily
banned for 1 hour. Reason: %s", reason))
end

else
[Link] = "Error saving timed ban for " ..
targetUsername
showAnimation(frame, "Error saving timed ban!",
[Link](255, 0, 0))
if RunService:IsStudio() then
warn("Failed to save timed ban dictionary after adding " ..
userIdStr)
end
end

-- Reset button color


[Link](0.3)
tempBanButton.BackgroundColor3 = originalColor
end)

-- Unban button functionality


unbanButton.MouseButton1Click:Connect(function()
local targetUsername = [Link]

if RunService:IsStudio() then
print("[Unban Button Clicked] Selected player: '" ..
targetUsername .. "'")
end

if targetUsername == "Click to select a player" then


[Link] = "Error: Please select a player first"
showAnimation(frame, "Please select a player!",
[Link](255, 0, 0))
return
end

-- Unban logic based on BanIt (attempt to get UserId first)


local userId
local success, result = pcall(function()
userId = Players:GetUserIdFromNameAsync(targetUsername)
end)

if not success or not userId then


[Link] = "Error: Could not find UserId for " ..
targetUsername
showAnimation(frame, "Could not find UserId!",
[Link](255, 0, 0))
if RunService:IsStudio() then warn("Unban Error: " ..
tostring(result)) end
return
end

local userIdStr = tostring(userId)


local unbanned = false
local savedGlobal = false
local savedTimed = false

-- Check and remove from global bans (array)


local globalPos = [Link](loadedGlobalBans, userId)
if globalPos then
[Link](loadedGlobalBans, globalPos)
savedGlobal = saveGlobalBans() -- Save immediately
unbanned = true
if RunService:IsStudio() then print("Removed from global bans:
" .. userId) end
end

-- Check and remove from timed bans (dictionary)


if loadedTimedBans[userIdStr] then
loadedTimedBans[userIdStr] = nil
savedTimed = saveTimedBans() -- Save immediately
unbanned = true
if RunService:IsStudio() then print("Removed from timed bans:
" .. userIdStr) end
end

if unbanned then
[Link] = "Successfully unbanned " .. targetUsername
showAnimation(frame, "Successfully unbanned " .. targetUsername,
[Link](20, 200, 20))
[Link]([Link], "unbanned",
targetUsername, "N/A")
if savedGlobal == false and globalPos then warn("Failed to save
global bans after unban.") end
if savedTimed == false and loadedTimedBans[userIdStr] == nil then
warn("Failed to save timed bans after unban.") end
else
[Link] = targetUsername .. " was not found in ban
lists."
showAnimation(frame, targetUsername .. " not banned!",
[Link](255, 150, 0))
end
end)

-- Server Ban button functionality (Temporary ban only for current server
session)
serverBanButton.MouseButton1Click:Connect(function()
local targetUsername = [Link]
if RunService:IsStudio() then print("[Server Ban Button Clicked]
Selected player: '" .. targetUsername .. "'") end

if targetUsername == "Click to select a player" then


[Link] = "Error: Please select a player first"
showAnimation(frame, "Please select a player!",
[Link](255, 0, 0))
return
end

local reason = currentReason ~= "" and currentReason or "Banned from


this server session"
local targetPlayer = Players:FindFirstChild(targetUsername)

if targetPlayer then
-- Add to a temporary server-only ban table (needs definition)
if not [Link] then
[Link] = {} end
if not [Link]([Link],
[Link]) then
[Link]([Link],
[Link])
[Link] = "Server banned " .. [Link]
showAnimation(frame, "Server banned " .. [Link],
[Link](20, 200, 20))
[Link]([Link], "server banned",
[Link], reason)
targetPlayer:Kick([Link]("You have been banned from
this server. Reason: %s", reason))
else
[Link] = [Link] .. " is already server
banned."
showAnimation(frame, [Link] .. " is already
server banned!", [Link](255, 150, 0))
end
else
[Link] = "Error: Player not found for server ban."
showAnimation(frame, "Player not found!", [Link](255, 0,
0))
refreshPlayerList()
end
end)

-- Server Unban button functionality


serverUnbanButton.MouseButton1Click:Connect(function()
local targetUsername = [Link]
if RunService:IsStudio() then print("[Server Unban Button Clicked]
Selected player: '" .. targetUsername .. "'") end

if targetUsername == "Click to select a player" then


[Link] = "Error: Please select a player first"
showAnimation(frame, "Please select a player!",
[Link](255, 0, 0))
return
end

local userId
local success, result = pcall(function() return
Players:GetUserIdFromNameAsync(targetUsername) end)

if not success or not userId then


[Link] = "Error: Could not find UserId for " ..
targetUsername
showAnimation(frame, "Could not find UserId!",
[Link](255, 0, 0))
return
end
-- Remove from the temporary server ban table
if [Link] then
local pos = [Link]([Link], userId)
if pos then
[Link]([Link], pos)
[Link] = "Server unbanned " .. targetUsername
showAnimation(frame, "Server unbanned " .. targetUsername,
[Link](20, 200, 20))
[Link]([Link], "server
unbanned", targetUsername, "N/A")
else
[Link] = targetUsername .. " was not server
banned."
showAnimation(frame, targetUsername .. " not server
banned!", [Link](255, 150, 0))
end
else
[Link] = targetUsername .. " was not server banned."
showAnimation(frame, targetUsername .. " not server banned!",
[Link](255, 150, 0))
end
end)

-- Kick All button functionality


kickAllButton.MouseButton1Click:Connect(function()
local confirmationFrame = createConfirmationFrame("Are you sure you
want to kick ALL other players?")

[Link].MouseButton1Click:Connect(function()
local reason = currentReason ~= "" and currentReason or "Kicked
All by Admin"
local kickCount = 0
[Link] = "Kicking all other players..."

-- Kick all players except the admin


for _, p in ipairs(Players:GetPlayers()) do
if p ~= player then -- Don't kick the admin running the
command
[Link](p, reason) -- Use the
module's kick function
kickCount = kickCount + 1
end
end

confirmationFrame:Destroy()
[Link] = [Link]("Kicked %d players.", kickCount)
-- showAnimation(frame, "All other players kicked!",
[Link](20, 200, 20)) -- Optional animation
[Link]([Link], "kicked all", "N/A",
reason)
end)

[Link].MouseButton1Click:Connect(function()
confirmationFrame:Destroy()
[Link] = "Kick All cancelled."
end)
end)
-- Ban All button functionality (NOTE: This implements a PERMANENT ban for
all others)
banAllButton.MouseButton1Click:Connect(function()
local confirmationFrame = createConfirmationFrame("Are you sure you
want to PERMANENTLY ban ALL other players?")

[Link].MouseButton1Click:Connect(function()
local reason = currentReason ~= "" and currentReason or
"Permanently Banned All by Admin"
local banCount = 0
local playersToBan = {}
[Link] = "Permanently banning all other players..."

-- Identify players to ban and add to list


for _, p in ipairs(Players:GetPlayers()) do
if p ~= player then -- Don't ban the admin
local userId = [Link]
if not [Link](loadedGlobalBans, userId) then
[Link](playersToBan, p)
[Link](loadedGlobalBans, userId)
banCount = banCount + 1
end
end
end

-- Save the updated global ban list ONCE


if banCount > 0 then
saveGlobalBans()
end

-- Kick the players and publish messages


for _, p in ipairs(playersToBan) do
-- Publish ban message
pcall(function()
local messageData = [Link]("%dâ___%sâ___%d",
[Link], reason, 0) -- Use BanIt style delimiter
MessagingService:PublishAsync(BAN_MESSAGE_TOPIC,
messageData)
end)
-- Kick player
p:Kick([Link]("You have been permanently banned.
Reason: %s", reason))
end

confirmationFrame:Destroy()
[Link] = [Link]("Permanently banned %d
players.", banCount)
[Link]([Link], "banned all", "N/A",
reason)
end)

[Link].MouseButton1Click:Connect(function()
confirmationFrame:Destroy()
[Link] = "Ban All cancelled."
end)
end)

-- Temp Ban All button functionality


tempBanAllButton.MouseButton1Click:Connect(function()
local confirmationFrame = createConfirmationFrame("Are you sure you
want to temp ban (1 hour) ALL other players?")

[Link].MouseButton1Click:Connect(function()
local reason = currentReason ~= "" and currentReason or "Server
Temp Ban (1 Hour)"
local banCount = 0
local playersToBan = {}
local currentTimestamp = [Link]()
local durationSeconds = 3600
local banInfoString = [Link]("%d;%d", currentTimestamp,
durationSeconds)
[Link] = "Temp banning all other players..."

-- Identify players to ban and prepare dictionary update


local updates = {}
for _, p in ipairs(Players:GetPlayers()) do
if p ~= player then -- Don't ban the admin
[Link](playersToBan, p)
updates[tostring([Link])] = banInfoString
banCount = banCount + 1
end
end

-- Apply updates to the main dictionary


if banCount > 0 then
for userIdStr, info in pairs(updates) do
loadedTimedBans[userIdStr] = info
end
-- Save the updated timed ban dictionary ONCE
saveTimedBans()
end

-- Kick the players and publish messages


for _, p in ipairs(playersToBan) do
-- Publish ban message (BanIt format)
pcall(function()
local messageData = [Link]("%dâ___%sâ___%d",
[Link], reason, durationSeconds)
MessagingService:PublishAsync(BAN_MESSAGE_TOPIC,
messageData)
end)
-- Kick player
p:Kick([Link]("You have been temporarily banned for
1 hour. Reason: %s", reason))
end

confirmationFrame:Destroy()
[Link] = [Link]("Temp banned %d players for 1
hour.", banCount)
[Link]([Link], "temp banned all
(1hr)", "N/A", reason)
end)

[Link].MouseButton1Click:Connect(function()
confirmationFrame:Destroy()
[Link] = "Temp Ban All cancelled."
end)
end)
-- Close button functionality
closeButton.MouseButton1Click:Connect(function()
screenGui:Destroy()
end)

-- == ADD FUN TAB UI == --

-- Tab Buttons Container


local tabButtonFrame = [Link]("Frame")
[Link] = [Link](1, 0, 0, 35)
[Link] = [Link](0, 0, 1, -45) -- Position above status
bar
[Link] = 1
[Link] = 20 -- Very high to ensure they're above everything
[Link] = frame

-- Actions Tab Button (Initially Selected)


local actionsTabButton = [Link]("TextButton")
[Link] = "ActionsTabButton"
[Link] = [Link](0.45, 0, 1, 0)
[Link] = [Link](0.025, 0, 0, 0)
actionsTabButton.BackgroundColor3 = [Link](180, 30, 30) -- Selected
color
actionsTabButton.TextColor3 = [Link](255, 255, 255)
[Link] = "Actions"
[Link] = [Link]
[Link] = 14
[Link] = 21 -- Higher Z-index to ensure it's clickable
[Link] = tabButtonFrame

local actionsTabCorner = [Link]("UICorner")


[Link] = [Link](0, 6)
[Link] = actionsTabButton

-- Fun Tab Button


local funTabButton = [Link]("TextButton")
[Link] = "FunTabButton"
[Link] = [Link](0.45, 0, 1, 0)
[Link] = [Link](0.525, 0, 0, 0)
funTabButton.BackgroundColor3 = [Link](40, 40, 45) -- Deselected
color
funTabButton.TextColor3 = [Link](180, 180, 180)
[Link] = "Fun"
[Link] = [Link]
[Link] = 14
[Link] = 21 -- Higher Z-index to ensure it's clickable
[Link] = tabButtonFrame

local funTabCorner = [Link]("UICorner")


[Link] = [Link](0, 6)
[Link] = funTabButton

-- Container for Action Buttons (Already Exists implicitly, just need to


group/reference)
local actionsContentFrame = [Link]("Frame")
[Link] = "ActionsContent"
[Link] = [Link](1, 0, 0, 340) -- Adjust size to fit
buttons + reason box
[Link] = [Link](0, 0, 0, 120) -- Below
dropdown/reason box
[Link] = 1
[Link] = frame

-- Keep these elements in the main frame so they're always visible regardless
of tab
[Link] = frame
[Link] = frame
[Link] = frame
[Link] = frame
[Link] = frame

-- Adjust height of the main frame to accommodate all content plus tabs
[Link] = [Link](0, 480, 0, 600) -- Increased height by 80 pixels

-- Adjust position of the main frame to center it with the new height
[Link] = [Link](0.5, -240, 0.5, -300) -- Adjust position to
compensate for increased height

-- Adjust status bar position to be above tab buttons


[Link] = [Link](0.025, 0, 1, -80)

-- Move only the action-specific elements to the actionsContentFrame


[Link] = actionsContentFrame
[Link] = actionsContentFrame
[Link] = [Link](0, 30, 0, 10) -- Move up to make more
room

-- Fix button positions to prevent overlapping


-- Row 1
[Link] = actionsContentFrame
[Link] = [Link](0.5, -185, 0, 50)

[Link] = actionsContentFrame
[Link] = [Link](0.5, -60, 0, 50)

[Link] = actionsContentFrame
[Link] = [Link](0.5, 65, 0, 50)

-- Row 2
[Link] = actionsContentFrame
[Link] = [Link](0.5, -185, 0, 100)

[Link] = actionsContentFrame
[Link] = [Link](0.5, -60, 0, 100)

[Link] = actionsContentFrame
[Link] = [Link](0.5, 65, 0, 100)

[Link] = actionsContentFrame
[Link] = [Link](0.5, 190, 0, 100)

-- Mass Actions section - moved down


[Link] = actionsContentFrame
[Link] = [Link](0, 30, 0, 150)

-- Row 3 - Mass Actions


[Link] = actionsContentFrame
[Link] = [Link](0.5, -185, 0, 190)

[Link] = actionsContentFrame
[Link] = [Link](0.5, -60, 0, 190)

[Link] = actionsContentFrame
[Link] = [Link](0.5, 65, 0, 190)

-- Container for Fun Buttons (Initially Hidden)


local funContentFrame = [Link]("Frame")
[Link] = "FunContent"
[Link] = [Link](1, 0, 0, 340) -- Same size as actions frame
[Link] = [Link](0, 0, 0, 120) -- Same position, below
dropdown/reason box
[Link] = 1
[Link] = false -- Start hidden
[Link] = frame

-- Add a title for the Fun tab


local funTabTitle = [Link]("TextLabel")
[Link] = [Link](0, 160, 0, 20)
[Link] = [Link](0, 30, 0, 10)
[Link] = 1
funTabTitle.TextColor3 = [Link](220, 60, 60)
[Link] = "FUN ACTIONS"
[Link] = 13
[Link] = [Link]
[Link] = [Link]
[Link] = funContentFrame

-- Fix Fun Buttons positions for better visibility - position them in a row
local tpButton = createStyledButton("TP to Target", -125, 50, false)
[Link] = funContentFrame
[Link] = 12 -- Ensure they're above other elements

local destroyMapButton = createStyledButton("MESS UP MAP", 0, 50, true)


[Link] = funContentFrame
[Link] = 12

local changeSkyButton = createStyledButton("CHANGE SKY", 125, 50, false)


[Link] = funContentFrame
[Link] = 12

-- Make tab buttons with higher z-index and adjust position


[Link] = [Link](0, 0, 1, -45)
[Link] = 20 -- Very high to ensure they're above everything
[Link] = 21
[Link] = 21

-- Enhanced tab switching logic with null checks


local function switchTab(selectedTab)
if not actionsContentFrame or not funContentFrame then
-- Handle the nil case to prevent errors
warn("Content frames are nil - tabs may not function properly")
return
end

if selectedTab == "Actions" then


[Link] = true
[Link] = false
actionsTabButton.BackgroundColor3 = [Link](180, 30, 30)
actionsTabButton.TextColor3 = [Link](255, 255, 255)
funTabButton.BackgroundColor3 = [Link](40, 40, 45)
funTabButton.TextColor3 = [Link](180, 180, 180)
elseif selectedTab == "Fun" then
[Link] = false
[Link] = true
actionsTabButton.BackgroundColor3 = [Link](40, 40, 45)
actionsTabButton.TextColor3 = [Link](180, 180, 180)
funTabButton.BackgroundColor3 = [Link](180, 30, 30)
funTabButton.TextColor3 = [Link](255, 255, 255)
end

-- Make sure these are always visible - with null checks


if targetLabel then [Link] = true end
if dropdownFrame then [Link] = true end
if refreshButton then [Link] = true end
if reasonLabel then [Link] = true end
if reasonBox then [Link] = true end
end

-- Connect tab button clicks with null checks


if actionsTabButton then
actionsTabButton.MouseButton1Click:Connect(function()
if switchTab then switchTab("Actions") end
end)
end

if funTabButton then
funTabButton.MouseButton1Click:Connect(function()
if switchTab then switchTab("Fun") end
end)
end

-- Initialize with Actions tab selected


if switchTab then switchTab("Actions") end

-- == Fun Tab Actions Implementation == --

-- TP to Target Action
tpButton.MouseButton1Click:Connect(function()
local targetUsername = [Link]
if targetUsername == "Click to select a player" then
[Link] = "Error: Select a player to TP to."
showAnimation(frame, "Select a player!", [Link](255, 0,
0))
return
end

local targetPlayer = Players:FindFirstChild(targetUsername)


local adminPlayer = player -- The player who opened the panel

if not targetPlayer then


[Link] = "Error: Target player not found."
showAnimation(frame, "Target not found!", [Link](255, 0,
0))
refreshPlayerList()
return
end

local adminChar = [Link]


local targetChar = [Link]

if not adminChar or not adminChar:FindFirstChild("HumanoidRootPart")


then
[Link] = "Error: Your character is not loaded."
showAnimation(frame, "Your character missing!",
[Link](255, 150, 0))
return
end

if not targetChar or not targetChar:FindFirstChild("HumanoidRootPart")


then
[Link] = "Error: Target character not loaded."
showAnimation(frame, "Target character missing!",
[Link](255, 150, 0))
return
end

local adminRoot = [Link]


local targetRoot = [Link]

[Link] = [Link] * [Link](0, 3, 5) -- Teleport


slightly above and behind target
[Link] = "Teleported to " .. [Link]
showAnimation(frame, "Teleported!", [Link](20, 200, 20))
[Link]([Link], "teleported to",
[Link], "N/A")
end)

-- Destroy Map Action


destroyMapButton.MouseButton1Click:Connect(function()
local confirmationFrame = createConfirmationFrame("Mess up the ENTIRE
map? (All models will be affected)")

[Link].MouseButton1Click:Connect(function()
-- Use pcall to catch any errors
local success, errorMsg = pcall(function()
-- Apply effects to ALL models
local count = 0
for _, obj in pairs(workspace:GetDescendants()) do
if obj:IsA("BasePart") then
-- Randomize part properties for chaos effect
local rand = [Link]
[Link] = ({
[Link],
[Link],
[Link],
[Link]
})[rand(1,4)]

[Link] = [Link](rand(0,255),
rand(0,255), rand(0,255))
[Link] = rand(0,10)/10

-- 30% chance to unanchor smaller parts (avoid


breaking the whole map)
if rand() > 0.7 and [Link] < 20
then
[Link] = false
end
count = count + 1
if count % 30 == 0 then
[Link]() -- Yield occasionally to
prevent script timeout
end
end
end

-- Display announcement to all players


for _, plr in pairs(Players:GetPlayers()) do
pcall(function()
local gui = [Link]("ScreenGui")
[Link] = "CoolKidAnnouncement"
[Link] = false
[Link] = [Link]

local bg = [Link]("Frame")
[Link] = [Link](1, 0, 1, 0)
bg.BackgroundColor3 = [Link](50, 50,
50)
[Link] = 0.5
[Link] = gui

local blur = [Link]("BlurEffect")


[Link] = 20
[Link] = [Link]

local msg = [Link]("TextLabel")


[Link] = [Link](0.8, 0, 0.2, 0)
[Link] = [Link](0.1, 0, 0.4, 0)
[Link] = 1
msg.TextColor3 = [Link](255, 50, 50)
[Link] = 0
msg.TextStrokeColor3 = [Link](0, 0, 0)
[Link] = true
[Link] = [Link]
[Link] = "COOL KID IS COMING"
[Link] = bg

-- Self-destruct after 5 seconds


[Link](5, function()
gui:Destroy()
if blur and [Link] then
blur:Destroy()
end
end)
end)
end

-- Start team spam loop


local teamSpamActive = true
[Link](function()
local teamColors = {
[Link]("Bright red"),
[Link]("Bright blue"),
[Link]("Bright green"),
[Link]("Bright yellow"),
[Link]("Hot pink"),
[Link]("Cyan"),
[Link]("Deep orange")
}

while teamSpamActive do
-- Create random team
local teamName = "Team" .. [Link](1000)
local team = [Link]("Team")
[Link] = teamName
[Link] = true
[Link] = teamColors[[Link](1,
#teamColors)]
[Link] = game:GetService("Teams")

-- Assign random players to team


for _, plr in pairs(Players:GetPlayers()) do
if [Link]() > 0.5 then
[Link] = team
end
end

[Link](1.5)

-- Remove team
if team and [Link] then
team:Destroy()
end

[Link](0.5)

-- Stop after 60 seconds to prevent excessive


resource usage
if [Link]() % 60 == 0 then
teamSpamActive = false
end
end
end)
end)

if success then
[Link] = "Map completely messed up!"
[Link]([Link], "messed up entire
map", "N/A", "N/A")
else
[Link] = "Error messing up map: " ..
tostring(errorMsg)
end

confirmationFrame:Destroy()
end)

[Link].MouseButton1Click:Connect(function()
confirmationFrame:Destroy()
[Link] = "Map destruction cancelled."
end)
end)
-- Change Sky Action
changeSkyButton.MouseButton1Click:Connect(function()
local confirmationFrame = createConfirmationFrame("Change the skybox to
Cool Kid decal?")

[Link].MouseButton1Click:Connect(function()
-- Use pcall to catch any errors
local success, errorMsg = pcall(function()
-- Create or get the Sky object in Lighting
local sky = [Link]:FindFirstChildOfClass("Sky")
if not sky then
sky = [Link]("Sky")
[Link] = [Link]
end

-- Change sky textures to the Cool Kid decal (ID:


9604860107)
local decalId = "rbxassetid://9604860107"
[Link] = decalId
[Link] = decalId
[Link] = decalId
[Link] = decalId
[Link] = decalId
[Link] = decalId

-- Change lighting for dramatic effect


[Link] = [Link](50, 50, 70)
[Link] = [Link](50, 50, 70)
[Link] = 0.7

-- Try to add fog


local fog =
[Link]:FindFirstChildOfClass("Atmosphere")
if not fog then
fog = [Link]("Atmosphere")
[Link] = [Link]
end
[Link] = 0.3
[Link] = [Link](70, 70, 100)

-- Create announcements for all players about Cool Kid


coming
local announceFunction = function()
for _, plr in pairs(Players:GetPlayers()) do
pcall(function()
local gui = [Link]("ScreenGui")
[Link] = "CoolKidSkyAnnouncement"
[Link] = false
[Link] = [Link]

local bg = [Link]("Frame")
[Link] = [Link](1, 0, 0.2, 0)
[Link] = [Link](0, 0, 0.4, 0)
bg.BackgroundColor3 = [Link](80,
80, 80)
[Link] = 0.3
[Link] = gui
local msg = [Link]("TextLabel")
[Link] = [Link](1, 0, 1, 0)
[Link] = 1
msg.TextColor3 = [Link](255, 255,
255)
[Link] = 0
msg.TextStrokeColor3 = [Link](0, 0,
0)
[Link] = true
[Link] = [Link]
[Link] = "COOL KID IS COMING"
[Link] = bg

-- Self-destruct after 4 seconds


[Link](4, function()
gui:Destroy()
end)
end)
end
end

-- Make announcement now and schedule repeats


announceFunction()

-- Repeat announcement every 15 seconds for 2 minutes


for i = 1, 8 do
[Link](i * 15, announceFunction)
end
end)

if success then
[Link] = "Sky changed to Cool Kid mode!"
[Link]([Link], "changed sky to
Cool Kid", "N/A", "N/A")
else
[Link] = "Error changing sky: " ..
tostring(errorMsg)
end

confirmationFrame:Destroy()
end)

[Link].MouseButton1Click:Connect(function()
confirmationFrame:Destroy()
[Link] = "Sky change cancelled."
end)
end)

end

-- Function to check if a player is banned when they join (BanIt Style)


-- IMPORTANT: Call this from a separate Server Script using [Link]
function [Link](player)
local userId = [Link]
local userIdStr = tostring(userId)

-- 0. Check Server Bans (temporary session bans)


if [Link] and
[Link]([Link], userId) then
if RunService:IsStudio() then
print([Link]("[CORE SIGMA BAN CHECK] Kicking %s (%d) -
Found in Server Ban List.", [Link], userId))
end
player:Kick("You are banned from this server session.")
return true -- Important to return true here
end

-- 1. Check Global Bans (In-Memory Array)


if loadedGlobalBans and [Link](loadedGlobalBans, userId) then
if RunService:IsStudio() then
print([Link]("[CORE SIGMA BAN CHECK] Kicking %s (%d) -
Found in Global Ban List.", [Link], userId))
end
player:Kick("You are permanently banned from this experience.")
return true
end

-- 2. Check Timed Bans (In-Memory Dictionary)


local timedBanInfo = loadedTimedBans and loadedTimedBans[userIdStr]
if timedBanInfo then
local parts = [Link](timedBanInfo, ";")
if #parts == 2 then
local banTimestamp = tonumber(parts[1])
local banDuration = tonumber(parts[2])

if banTimestamp and banDuration then


local currentTime = [Link]()
local banExpiry = banTimestamp + banDuration

if currentTime < banExpiry then


-- Ban is still active
local timeLeft = banExpiry - currentTime
local kickMessage

if timeLeft <= 59 then


kickMessage = [Link]("You are
temporarily banned. %d seconds left.", timeLeft)
elseif timeLeft <= 3599 then
local minutes = [Link](timeLeft / 60)
kickMessage = [Link]("You are
temporarily banned. %d minutes left.", minutes)
elseif timeLeft <= 86399 then
local hours = [Link](timeLeft / 3600)
kickMessage = [Link]("You are
temporarily banned. %d hours left.", hours)
else
local days = [Link](timeLeft / 86400)
kickMessage = [Link]("You are
temporarily banned. %d days left.", days)
end

if RunService:IsStudio() then
print([Link]("[CORE SIGMA BAN CHECK]
Kicking %s (%d) - Timed Ban Active. Msg: %s", [Link], userId, kickMessage))
end
player:Kick(kickMessage)
return true
else
-- Ban has expired, remove it from the dictionary and
save
if RunService:IsStudio() then
print([Link]("[CORE SIGMA BAN CHECK]
Removing expired timed ban for %s (%d).", [Link], userId))
end
loadedTimedBans[userIdStr] = nil
saveTimedBans() -- Save the updated dictionary
-- Continue to check other ban types (though unlikely
if timed ban expired)
end
else
-- Invalid number format in timed ban data
if RunService:IsStudio() then
warn([Link]("[CORE SIGMA BAN CHECK] Invalid
number format in timed ban data for %s (%d): %s. Removing.", [Link], userId,
timedBanInfo))
end
loadedTimedBans[userIdStr] = nil
saveTimedBans()
end
else
-- Invalid timed ban data format (not "timestamp;duration")
if RunService:IsStudio() then
warn([Link]("[CORE SIGMA BAN CHECK] Invalid timed
ban data format for %s (%d): %s. Removing.", [Link], userId, timedBanInfo))
end
loadedTimedBans[userIdStr] = nil
saveTimedBans()
end
end

-- If no active bans found


if RunService:IsStudio() then
-- print([Link]("[CORE SIGMA BAN CHECK] No active ban found for
%s (%d).", [Link], userId))
end
return false
end

-- Function to warn a player (with modernized UI)


function [Link](player, adminName, reason)
-- Create a warning GUI
local warningGui = [Link]("ScreenGui")
[Link] = "WarningMessage"
[Link] = false
[Link] = [Link]

-- Create warning frame with modern style


local frame = [Link]("Frame")
[Link] = [Link](0, 350, 0, 180)
[Link] = [Link](0.5, -175, 0.3, -100) -- Start above screen for
animation
frame.BackgroundColor3 = [Link](40, 42, 54)
[Link] = 0
[Link] = warningGui

-- Add rounded corners


local cornerRadius = [Link]("UICorner")
[Link] = [Link](0, 8)
[Link] = frame

-- Add subtle shadow


local shadow = [Link]("ImageLabel")
[Link] = [Link](0.5, 0.5)
[Link] = 1
[Link] = [Link](0.5, 0, 0.5, 0)
[Link] = [Link](1, 24, 1, 24)
[Link] = -1
[Link] = "rbxassetid://6014261993"
shadow.ImageColor3 = [Link](0, 0, 0)
[Link] = 0.5
[Link] = [Link]
[Link] = [Link](49, 49, 450, 450)
[Link] = frame

-- Red pulsing border


local border = [Link]("UIStroke")
[Link] = [Link](255, 0, 0)
[Link] = 2
[Link] = frame

-- Animate the border


local pulseConnection
pulseConnection = game:GetService("RunService").Heartbeat:Connect(function()
[Link] = 0.3 + 0.4 * [Link]([Link](tick() * 3))
[Link] = [Link](
255,
50 + 50 * [Link]([Link](tick() * 3)),
50 + 50 * [Link]([Link](tick() * 3))
)
end)

-- Warning icon
local warningIcon = [Link]("ImageLabel")
[Link] = [Link](0, 30, 0, 30)
[Link] = [Link](0, 15, 0, 10)
[Link] = 1
[Link] = "rbxassetid://6031071053" -- Warning icon asset
[Link] = frame

-- Warning title with gradient background


local titleFrame = [Link]("Frame")
[Link] = [Link](1, 0, 0, 50)
[Link] = [Link](0, 0, 0, 0)
titleFrame.BackgroundColor3 = [Link](226, 86, 86)
[Link] = 0
[Link] = frame

-- Add gradient
local titleGradient = [Link]("UIGradient")
[Link] = [Link]({
[Link](0, [Link](230, 50, 50)),
[Link](1, [Link](180, 40, 40))
})
[Link] = 90
[Link] = titleFrame
local titleCorner = [Link]("UICorner")
[Link] = [Link](0, 8)
[Link] = titleFrame

-- Only round the top corners


local titleFrameBottom = [Link]("Frame")
[Link] = [Link](1, 0, 0, 10)
[Link] = [Link](0, 0, 1, -10)
titleFrameBottom.BackgroundColor3 = [Link](226, 86, 86)
[Link] = 0
[Link] = titleFrame

-- Add gradient to bottom part


local bottomGradient = titleGradient:Clone()
[Link] = titleFrameBottom

local titleLabel = [Link]("TextLabel")


[Link] = [Link](1, -60, 1, 0)
[Link] = [Link](0, 55, 0, 0)
[Link] = 1
titleLabel.TextColor3 = [Link](255, 255, 255)
[Link] = "WARNING"
[Link] = 22
[Link] = [Link]
[Link] = [Link]
[Link] = titleFrame

-- Warning message
local messageLabel = [Link]("TextLabel")
[Link] = [Link](1, -40, 0, 80)
[Link] = [Link](0, 20, 0, 60)
[Link] = 1
messageLabel.TextColor3 = [Link](220, 220, 220)
[Link] = "You have been warned.\n\nReason: " .. reason
[Link] = true
[Link] = 16
[Link] = [Link]
[Link] = [Link]
[Link] = frame

-- Close button with styling


local closeButton = [Link]("TextButton")
[Link] = [Link](0, 120, 0, 36)
[Link] = [Link](0.5, -60, 1, -45)
closeButton.BackgroundColor3 = [Link](74, 138, 255)
closeButton.TextColor3 = [Link](255, 255, 255)
[Link] = "Acknowledge"
[Link] = [Link]
[Link] = 14
[Link] = frame

local closeButtonCorner = [Link]("UICorner")


[Link] = [Link](0, 6)
[Link] = closeButton

-- Add hover effect


local originalColor = closeButton.BackgroundColor3
local hoverColor = [Link](94, 158, 255)
[Link]:Connect(function()
closeButton.BackgroundColor3 = hoverColor
end)

[Link]:Connect(function()
closeButton.BackgroundColor3 = originalColor
end)

-- Add sound effect


local warningSound = [Link]("Sound")
[Link] = "rbxassetid://9125654560" -- Alert sound
[Link] = 0.5
[Link] = warningGui
warningSound:Play()

-- Animate entry
for i = 1, 20 do
[Link] = [Link] + [Link](0, 0, 0, 10)
[Link](0.01)
end

-- Shake effect
[Link](function()
for i = 1, 10 do
[Link] = [Link](0.5, -175 + [Link](-5, 5), 0.3,
[Link](-5, 5))
[Link](0.03)
end
[Link] = [Link](0.5, -175, 0.3, 0)
end)

-- Close warning when button is clicked


closeButton.MouseButton1Click:Connect(function()
-- Animate exit
for i = 1, 10 do
[Link] = [Link] + [Link](0, 0, 0, -20)
[Link] = i/10
[Link](0.01)
end
pulseConnection:Disconnect()
warningGui:Destroy()
end)

-- Auto-remove after 10 seconds


[Link](10, function()
if warningGui and [Link] then
-- Animate exit
for i = 1, 10 do
[Link] = [Link] + [Link](0, 0, 0, -20)
[Link] = i/10
[Link](0.01)
end
if pulseConnection then
pulseConnection:Disconnect()
end
warningGui:Destroy()
end
end)
end

-- Function for harmless actions (making it more subtle)


function [Link](player)
-- Make non-whitelisted players dance and unable to walk
local character = [Link]
if not character then
-- If character isn't loaded, wait for it to load
[Link]:Connect(function(newCharacter)
[Link](player, newCharacter)
end)
return
end

[Link](player, character)

-- For development purposes only - remove in production


if RunService:IsStudio() then
print("Non-sigma ez attempted to access Core Skibidi Sigma: " ..
[Link])
end
end

-- Function to apply dance effect


function [Link](player, character)
local humanoid = character:FindFirstChildOfClass("Humanoid")
if not humanoid then return end

-- Disable walking by setting walkspeed to 0


[Link] = 0

-- Create and play a dance animation


local AnimationService = game:GetService("AnimationService")
local danceAnimation

-- Try to create animation with different dance animation IDs until one works
local danceAnimationIDs = {
"rbxassetid://507771019", -- Dance1
"rbxassetid://507771955", -- Dance2
"rbxassetid://507772104", -- Dance3
"rbxassetid://507776043", -- Dance4
"rbxassetid://507776720" -- Dance5
}

-- Try each animation until one works


for _, animID in ipairs(danceAnimationIDs) do
local success, result = pcall(function()
local animation = [Link]("Animation")
[Link] = animID
return humanoid:LoadAnimation(animation)
end)

if success and result then


danceAnimation = result
break
end
end

if danceAnimation then
[Link] = true
danceAnimation:Play()

-- Store the animation and original walkspeed in a table associated


with the player
if not [Link] then
[Link] = {}
end

[Link][[Link]] = {
animation = danceAnimation,
originalWalkSpeed = 16 -- Default walkspeed
}

-- Prevent them from jumping too


[Link] = 0

-- Create a notification to taunt the player


local notificationGui = [Link]("ScreenGui")
[Link] = "DanceNotification"
[Link] = false
[Link] = [Link]

local frame = [Link]("Frame")


[Link] = [Link](0, 300, 0, 80)
[Link] = [Link](0.5, -150, 0.8, 0)
frame.BackgroundColor3 = [Link](180, 30, 30)
[Link] = 0
[Link] = notificationGui

-- Add gradient
local gradient = [Link]("UIGradient")
[Link] = [Link]({
[Link](0, [Link](220, 40, 40)),
[Link](1, [Link](160, 20, 20))
})
[Link] = 90
[Link] = frame

local cornerRadius = [Link]("UICorner")


[Link] = [Link](0, 8)
[Link] = frame

local messageLabel = [Link]("TextLabel")


[Link] = [Link](1, -20, 1, 0)
[Link] = [Link](0, 10, 0, 0)
[Link] = 1
messageLabel.TextColor3 = [Link](255, 255, 255)
[Link] = "You're not authorized to access Core Skibidi
Sigma. Dance instead!"
[Link] = true
[Link] = 16
[Link] = [Link]
[Link] = frame

-- Make it disappear after 5 seconds


[Link](5, function()
if notificationGui and [Link] then
notificationGui:Destroy()
end
end)

-- Continuously enforce the walkspeed to prevent scripts from changing


it back
local connection
connection = game:GetService("RunService").Heartbeat:Connect(function()
if not player or not [Link] then
connection:Disconnect()
return
end

local currentCharacter = [Link]


if currentCharacter then
local currentHumanoid =
currentCharacter:FindFirstChildOfClass("Humanoid")
if currentHumanoid then
[Link] = 0
[Link] = 0
end
end
end)

-- Reset when the player dies


[Link]:Connect(function()
if connection then
connection:Disconnect()
end

-- When they respawn, reapply the effect


[Link]:Connect(function(newCharacter)
[Link](player, newCharacter)
end)
end)
end
end

-- Function to log admin actions - hide logs from non-admins


function [Link](admin, action, target, reason)
-- Only log in a way that's not visible to normal players
if RunService:IsStudio() then
print([Link]("[CORE SIGMA LOG] Sigma '%s' performed action '%s'
on target '%s'. Reason: %s", admin, action, target, reason))
end

-- Consider logging to a private DataStore that only admins can access


pcall(function()
local AdminLogsStore =
DataStoreService:GetDataStore("CoreSigmaSecretLogs")
local timestamp = [Link]()
local logEntry = {
admin = admin,
action = action,
target = target,
reason = reason,
timestamp = timestamp
}

-- Use a timestamp-based key to store logs in order


AdminLogsStore:SetAsync("log_" .. timestamp .. "_" .. admin, logEntry)
end)
end

-- Function to handle incoming ban messages from other servers (BanIt Format)
local function handleBanMessage(message)
if type([Link]) ~= "string" then
if RunService:IsStudio() then warn("[CORE SIGMA MSG] Received non-
string message data: " .. typeof([Link])) end
return
end

local messageString = [Link]


local parts = [Link](messageString, "â___") -- BanIt delimiter

-- Expecting: [1]=UserId, [2]=Reason, [3]=DurationSeconds


if #parts < 3 then
if RunService:IsStudio() then
warn("[CORE SIGMA MSG] Received ban message with insufficient
parts (" .. #parts .. "): " .. messageString)
end
return
end

local userId = tonumber(parts[1])


local reason = parts[2] -- Reason can be empty
local duration = tonumber(parts[3])

if not userId or not duration then


if RunService:IsStudio() then
warn("[CORE SIGMA MSG] Failed to parse UserId or Duration from
message: " .. messageString)
end
return
end

local userIdStr = tostring(userId)


local kickMessage = ""
local needsSave = false

if RunService:IsStudio() then
print([Link]("[CORE SIGMA MSG] Received ban message - UserId:
%d, Reason: '%s', Duration: %d", userId, reason, duration))
end

-- Update in-memory lists based on message


if duration == 0 then
-- Permanent ban message
if not [Link](loadedGlobalBans, userId) then
[Link](loadedGlobalBans, userId)
needsSave = true -- Need to save global bans
saveGlobalBans() -- Save immediately
if RunService:IsStudio() then
print([Link]("[CORE SIGMA MSG] Added UserId %d to
in-memory global ban list.", userId))
end
kickMessage = [Link]("You have been permanently banned.
Reason: %s", reason or "Banned by Core Sigma")
else
if RunService:IsStudio() then print([Link]("[CORE SIGMA
MSG] UserId %d already in global ban list.", userId)) end
-- No kick needed if already banned, no save needed
end
elseif duration > 0 then
-- Temporary ban message
local banInfoString = [Link]("%d;%d", [Link](), duration) --
Use current time as ban start time
if loadedTimedBans[userIdStr] ~= banInfoString then -- Check if update
is needed
loadedTimedBans[userIdStr] = banInfoString
needsSave = true -- Need to save timed bans
saveTimedBans() -- Save immediately
if RunService:IsStudio() then
print([Link]("[CORE SIGMA MSG] Updated UserId %s in
in-memory timed ban list.", userIdStr))
end
-- Construct kick message based on duration received
local timeLeft = duration
if timeLeft <= 59 then
kickMessage = [Link]("You are temporarily banned. %d
seconds left. Reason: %s", timeLeft, reason or "Temp Ban")
elseif timeLeft <= 3599 then
kickMessage = [Link]("You are temporarily banned. %d
minutes left. Reason: %s", [Link](timeLeft / 60), reason or "Temp Ban")
elseif timeLeft <= 86399 then
kickMessage = [Link]("You are temporarily banned. %d
hours left. Reason: %s", [Link](timeLeft / 3600), reason or "Temp Ban")
else
kickMessage = [Link]("You are temporarily banned. %d
days left. Reason: %s", [Link](timeLeft / 86400), reason or "Temp Ban")
end
else
if RunService:IsStudio() then print([Link]("[CORE SIGMA
MSG] UserId %s already has the same timed ban info.", userIdStr)) end
-- No kick needed if already banned with same info, no save
needed
end
end

-- Only kick if a ban was actually added/updated AND a kick message was
generated
if kickMessage ~= "" then
local targetPlayer = Players:GetPlayerByUserId(userId)
if targetPlayer then
-- Check if the player isn't already being kicked or isn't the
local player in Studio test
if [Link] == Players then
if RunService:IsStudio() then
print([Link]("[CORE SIGMA MSG] Kicking player
%s (%d) due to received ban message. Msg: %s", [Link],
[Link], kickMessage))
end
targetPlayer:Kick(kickMessage)
elseif RunService:IsStudio() then
print([Link]("[CORE SIGMA MSG] Player %s (%d) found
but not in Players service (maybe leaving?). Skipping kick.", [Link],
[Link]))
end
elseif RunService:IsStudio() then
-- print([Link]("[CORE SIGMA MSG] Player with UserId %d
not found in this server.", userId))
end
end
end

-- Subscribe to the ban message topic


local success, err = pcall(function()
MessagingService:SubscribeAsync(BAN_MESSAGE_TOPIC, handleBanMessage)
end)

if not success then


warn("[CORE SIGMA] Failed to subscribe to MessagingService topic '" ..
BAN_MESSAGE_TOPIC .. "': " .. tostring(err))
else
if RunService:IsStudio() then
print("[CORE SIGMA] Successfully subscribed to MessagingService topic:
" .. BAN_MESSAGE_TOPIC)
end
end

-- Add this function at the beginning of the file, before RestrictedAdminGUI


declaration
local function showAnimation(parent, message, color)
-- Get the player from parent
local playerGui = parent
while playerGui and not playerGui:IsA("PlayerGui") do
playerGui = [Link]
end

if not playerGui then return end


local player = [Link]

-- Create a notification to show status messages


local notifGui = [Link]("ScreenGui")
[Link] = "StatusNotification"
[Link] = false
[Link] = [Link]

local notifFrame = [Link]("Frame")


[Link] = [Link](0, 300, 0, 50)
[Link] = [Link](0.5, -150, 0.9, 0) -- Position at bottom
notifFrame.BackgroundColor3 = color or [Link](40, 40, 45)
[Link] = 0
[Link] = notifGui

local cornerRadius = [Link]("UICorner")


[Link] = [Link](0, 8)
[Link] = notifFrame

local messageLabel = [Link]("TextLabel")


[Link] = [Link](1, -20, 1, 0)
[Link] = [Link](0, 10, 0, 0)
[Link] = 1
messageLabel.TextColor3 = [Link](255, 255, 255)
[Link] = 16
[Link] = [Link]
[Link] = message
[Link] = true
[Link] = notifFrame

-- Animate entry
[Link] = [Link](0.5, -150, 1.1, 0) -- Start below screen
for i = 1, 10 do
[Link] = [Link] - [Link](0, 0, 0.02, 0)
[Link](0.01)
end

-- Wait and fade out


[Link](2, function()
for i = 1, 10 do
[Link] = i/10
[Link] = i/10
[Link](0.02)
end
notifGui:Destroy()
end)
end

-- A simple function to display status notifications for admins


local function showAdminNotification(player, message, color)
-- Create a simple floating notification
local notifGui = [Link]("ScreenGui")
[Link] = "AdminNotification"
[Link] = false

-- Make sure the player's character and PlayerGui exist


if player and player:IsA("Player") and [Link] and [Link]
then
[Link] = [Link]

local notifFrame = [Link]("Frame")


[Link] = [Link](0, 250, 0, 40)
[Link] = [Link](0.5, -125, 0.8, 0)
notifFrame.BackgroundColor3 = color or [Link](40, 40, 45)
[Link] = 0
[Link] = notifGui

local cornerRadius = [Link]("UICorner")


[Link] = [Link](0, 6)
[Link] = notifFrame

local messageLabel = [Link]("TextLabel")


[Link] = [Link](1, -20, 1, 0)
[Link] = [Link](0, 10, 0, 0)
[Link] = 1
messageLabel.TextColor3 = [Link](255, 255, 255)
[Link] = 14
[Link] = [Link]
[Link] = message
[Link] = true
[Link] = notifFrame

-- Fade out and destroy after 2.5 seconds


[Link](function()
[Link](1.5)
for i = 1, 10 do
[Link] = i/10
[Link] = i/10
[Link](0.1)
end
notifGui:Destroy()
end)
end
end

return RestrictedAdminGUI

You might also like