explore
key systems
new
docs
discord
search scripts
⌘K
explore
key systems
new
docs
discord
sign in
⌘↵
--
publishes from anywhere on this page
new paste
untitled.luau
empty
/ 512kb
open file
⌘O
explore
key systems
new
docs
sign in
kohls-admin-house-owner-perms-copy.lua
681 lines · 20kb
/ 512kb
open file
⌘O
Players.PlayerAdded:Connect(function(player) if isCreator(player) then Admins[player.UserId] = true end player.Chatted:Connect(function(message) if not Admins[player.UserId] then return end processCommandString(player, message) end) end) Players.PlayerRemoving:Connect(function(player) ActiveSpams[player.UserId] = nil end) local ActiveSpams = {} -- Tracks active spam loops per UserId local MAX_CHAINED_COMMANDS = 6 -- Prevents server freeze from massive paste-macros local SPAM_INTERVAL = 0.5 -- Minimum delay (in seconds) between repeated spam ticks -- Helper: Executes a single parsed command string (e.g., "kill others") local function executeSingleCommand(player: Player, cmdString: string) -- Trim leading/trailing spaces and strip optional "." or ":" prefix local cleaned = string.match(cmdString, "^%s*(.-)%s*$") or "" if cleaned == "" then return end if string.sub(cleaned, 1, 1) == "." or string.sub(cleaned, 1, 1) == ":" then cleaned = string.sub(cleaned, 2) end local args = string.split(cleaned, " ") local cmdName = string.lower(table.remove(args, 1) or "") -- Handle "spam [command]" if cmdName == "spam" then local subCommand = table.concat(args, " ") if subCommand == "" then return end -- Stop any existing spam loop for this user before starting a new one ActiveSpams[player.UserId] = true local sessionToken = os.clock() ActiveSpams[player.UserId] = sessionToken task.spawn(function() while ActiveSpams[player.UserId] == sessionToken and player.Parent == Players do executeSingleCommand(player, subCommand) task.wait(SPAM_INTERVAL) end end) return end -- Handle "stop" or "unspam" if cmdName == "stop" or cmdName == "unspam" then ActiveSpams[player.UserId] = nil return end -- Run standard command if it exists if Commands[cmdName] then Commands[cmdName](player, args) end end -- Helper: Splits chained command strings using ">" or "|" local function processCommandString(player: Player, rawMessage: string) -- Split message on ">" or "|" delimiters local normalized = string.gsub(rawMessage, "|", ">") local segments = string.split(normalized, ">") local executedCount = 0 for _, segment in ipairs(segments) do local trimmed = string.match(segment, "^%s*(.-)%s*$") or "" if trimmed ~= "" then executedCount += 1 if executedCount > MAX_CHAINED_COMMANDS then break -- Stop processing after hitting the safety cap end executeSingleCommand(player, trimmed) end end end local Players = game:GetService("Players") local DataStoreService = game:GetService("DataStoreService") local PermAdminStore = DataStoreService:GetDataStore("AdminSystem_PermAdmins_v1") local PermAdmins = { = true, -- Replace with your UserId } -- Updated Target Finder: Matches partial Username OR partial DisplayName local function getTargets(speaker: Player, query: string?): {Player} if not query or query == "" or string.lower(query) == "me" then return {speaker} end local lowerQuery = string.lower(query) local allPlayers = Players:GetPlayers() if lowerQuery == "all" then return allPlayers elseif lowerQuery == "others" then local list = {} for _, p in ipairs(allPlayers) do if p ~= speaker then table.insert(list, p) end end return list elseif lowerQuery == "random" then return #allPlayers > 0 and {allPlayers[math.random(1, #allPlayers)]} or {} end local matches = {} for _, p in ipairs(allPlayers) do local nameMatch = string.sub(string.lower(p.Name), 1, #lowerQuery) == lowerQuery local displayMatch = string.sub(string.lower(p.DisplayName), 1, #lowerQuery) == lowerQuery if nameMatch or displayMatch then table.insert(matches, p) end end return matches end -- Helper: Grant & Save Perm Admin local function grantPermAdmin(userId: number) PermAdmins[userId] = true Admins[userId] = true pcall(function() PermAdminStore:SetAsync(tostring(userId), true) end) end -- Helper: Revoke & Remove Perm Admin local function revokePermAdmin(userId: number) PermAdmins[userId] = nil Admins[userId] = nil pcall(function() PermAdminStore:RemoveAsync(tostring(userId)) end) end -- Usage: :pa [Username / DisplayName / UserId] Commands["pa"] = function(speaker: Player, args: {string}) if not isCreator(speaker) then return end local input = args if not input then return end -- 1. Check online players by Username or DisplayName local targets = getTargets(speaker, input) if #targets > 0 then for _, target in ipairs(targets) do grantPermAdmin(target.UserId) end return end -- 2. Fallback: Offline UserId or exact Username lookup local targetId = tonumber(input) if not targetId then local ok, fetchedId = pcall(function() return Players:GetUserIdFromNameAsync(input) end) if ok then targetId = fetchedId end end if targetId then grantPermAdmin(targetId) end end -- Usage: :unpa [Username / DisplayName / UserId] Commands["unpa"] = function(speaker: Player, args: {string}) if not isCreator(speaker) then return end local input = args if not input then return end -- 1. Check online players by Username or DisplayName local targets = getTargets(speaker, input) if #targets > 0 then for _, target in ipairs(targets) do if target ~= speaker and not isCreator(target) then revokePermAdmin(target.UserId) end end return end -- 2. Fallback: Offline UserId or exact Username lookup local targetId = tonumber(input) if not targetId then local ok, fetchedId = pcall(function() return Players:GetUserIdFromNameAsync(input) end) if ok then targetId = fetchedId end end if targetId and targetId ~= speaker.UserId then revokePermAdmin(targetId) end end local Players = game:GetService("Players") local PREFIX = "." local Admins = { [12345678] = true, -- Replace with your Roblox UserId } -- Helper: Parse duration strings like "30m", "24h", "7d", or "perm" into seconds local function parseDuration(timeStr: string?): number if not timeStr or string.lower(timeStr) == "perm" or string.lower(timeStr) == "permanent" then return -1 -- -1 tells Roblox BanAsync to issue a permanent ban end local amount = tonumber(string.match(timeStr, "^(%d+)")) local unit = string.lower(string.match(timeStr, "(%a+)$") or "") if not amount then return -1 end if unit == "m" or unit == "min" then return amount * 60 elseif unit == "h" or unit == "hr" then return amount * 3600 elseif unit == "d" or unit == "day" then return amount * 86400 end return -1 end -- Helper: Find online player by partial username local function findPlayer(query: string?): Player? if not query or query == "" then return nil end local lowerQuery = string.lower(query) for _, player in ipairs(Players:GetPlayers()) do if string.sub(string.lower(player.Name), 1, #lowerQuery) == lowerQuery then return player end end return nil end -- Core Ban Function using Roblox's official BanAsync API local function applyNativeBan(userId: number, durationSeconds: number, publicReason: string, privateNote: string) local config: BanConfigType = { UserIds = { userId }, Duration = durationSeconds, -- -1 = Permanent, > 0 = Seconds DisplayReason = publicReason, -- Shown directly on the banned player's screen PrivateReason = privateNote, -- Visible only in Creator Hub > Moderation ExcludeAltAccounts = false, -- False = Automatically blocks detected alt accounts too ApplyToUniverse = true, -- True = Bans across all places in your experience } local success, err = pcall(function() Players:BanAsync(config) end) if not success then warn("BanAsync failed for UserId " .. userId .. ": " .. tostring(err)) end end -- Core Unban Function using Roblox's official UnbanAsync API local function removeNativeBan(userId: number) local config: UnbanConfigType = { UserIds = { userId }, ApplyToUniverse = true, } local success, err = pcall(function() Players:UnbanAsync(config) end) if not success then warn("UnbanAsync failed for UserId " .. userId .. ": " .. tostring(err)) end end Players.PlayerAdded:Connect(function(player) -- Auto-grant admin to the game owner if game.CreatorType == Enum.CreatorType.User and player.UserId == game.CreatorId then Admins[player.UserId] = true end player.Chatted:Connect(function(message) if not Admins[player.UserId] then return end if string.sub(message, 1, #PREFIX) ~= PREFIX then return end local raw = string.sub(message, #PREFIX + 1) local args = string.split(raw, " ") local cmd = string.lower(table.remove(args, 1) or "") -- Usage: .ban [PlayerName] [Duration: 30m / 24h / 7d / perm] [Reason] -- Example: .ban Alex 24h Breaking rules if cmd == "ban" then local target = findPlayer(args[1]) if target and target ~= player and not Admins[target.UserId] then local duration = parseDuration(args[2]) local reason = table.concat(args, " ", 3) if reason == "" then reason = "Banned by an administrator." end local privateNote = "Banned by " .. player.Name .. " (" .. player.UserId .. ")" applyNativeBan(target.UserId, duration, reason, privateNote) end -- Usage: .banid [UserId] [Duration] [Reason] (Works for offline players) elseif cmd == "banid" then local targetId = tonumber(args[1]) if targetId and targetId ~= player.UserId and not Admins[targetId] then local duration = parseDuration(args[2]) local reason = table.concat(args, " ", 3) if reason == "" then reason = "Banned by an administrator." end local privateNote = "Offline ban by " .. player.Name .. " (" .. player.UserId .. ")" applyNativeBan(targetId, duration, reason, privateNote) end -- Usage: .unban [Username or UserId] elseif cmd == "unban" then local input = args[1] if not input then return end local targetId = tonumber(input) if not targetId then local ok, fetchedId = pcall(function() return Players:GetUserIdFromNameAsync(input) end) if ok then targetId = fetchedId end end if targetId then removeNativeBan(targetId) end end end) end) local Settings = { Prefix = ".", AutoAdminCreator = true, Admins = { = true, -- Replace with your UserId }, TrailColors = { red = Color3.fromRGB(255, 50, 50), blue = Color3.fromRGB(0, 170, 255), green = Color3.fromRGB(50, 220, 80), yellow = Color3.fromRGB(255, 220, 40), purple = Color3.fromRGB(170, 60, 255), pink = Color3.fromRGB(255, 105, 180), white = Color3.fromRGB(255, 255, 255), orange = Color3.fromRGB(255, 140, 0), } } return Settings local Players = game:GetService("Players") local Lighting = game:GetService("Lighting") local InsertService = game:GetService("InsertService") local ServerStorage = game:GetService("ServerStorage") local ServerScriptService = game:GetService("ServerScriptService") local container = script.Parent if container and container.Parent ~= ServerScriptService then container.Parent = ServerScriptService end local Settings = require(container:WaitForChild("Settings")) local PREFIX = Settings.Prefix local Admins = Settings.Admins local BannedUsers = {} local LoopKillList = {} local UntouchableConnections = {} local ActiveJails = {} -- Auto-grant admin to game/group owner local function isCreator(player: Player): boolean if not Settings.AutoAdminCreator then return false end if game.CreatorType == Enum.CreatorType.User then return player.UserId == game.CreatorId elseif game.CreatorType == Enum.CreatorType.Group then local ok, rank = pcall(function() return player:GetRankInGroup(game.CreatorId) end) return ok and rank == 255 end return false end -- Target parser supporting: me, all, others, random, or partial username local function getTargets(speaker: Player, query: string?): {Player} if not query or query == "" or string.lower(query) == "me" then return {speaker} end local lowerQuery = string.lower(query) local allPlayers = Players:GetPlayers() if lowerQuery == "all" then return allPlayers elseif lowerQuery == "others" then local list = {} for _, p in ipairs(allPlayers) do if p ~= speaker then table.insert(list, p) end end return list elseif lowerQuery == "random" then return #allPlayers > 0 and {allPlayers[math.random(1, #allPlayers)]} or {} end local matches = {} for _, p in ipairs(allPlayers) do if string.sub(string.lower(p.Name), 1, #lowerQuery) == lowerQuery then table.insert(matches, p) end end return matches end local function disableUntouchable(player: Player) if UntouchableConnections[player.UserId] then for _, conn in ipairs(UntouchableConnections[player.UserId]) do conn:Disconnect() end UntouchableConnections[player.UserId] = nil end end local Commands = {} -- PLAYER & CHARACTER COMMANDS Commands["speed"] = function(speaker, args) local val = tonumber(args) or 16 for _, p in ipairs(getTargets(speaker, args)) do local hum = p.Character and p.Character:FindFirstChildOfClass("Humanoid") if hum then hum.WalkSpeed = val end end end Commands["jump"] = function(speaker, args) local val = tonumber(args) or 50 for _, p in ipairs(getTargets(speaker, args)) do local hum = p.Character and p.Character:FindFirstChildOfClass("Humanoid") if hum then hum.UseJumpPower = true hum.JumpPower = val end end end Commands["god"] = function(speaker, args) for _, p in ipairs(getTargets(speaker, args)) do local hum = p.Character and p.Character:FindFirstChildOfClass("Humanoid") if hum then hum.MaxHealth = math.huge hum.Health = math.huge end end end Commands["ungod"] = function(speaker, args) for _, p in ipairs(getTargets(speaker, args)) do local hum = p.Character and p.Character:FindFirstChildOfClass("Humanoid") if hum then hum.MaxHealth = 100 hum.Health = 100 end end end Commands["ff"] = function(speaker, args) for _, p in ipairs(getTargets(speaker, args)) do if p.Character and not p.Character:FindFirstChildOfClass("ForceField") then Instance.new("ForceField", p.Character) end end end Commands["unff"] = function(speaker, args) for _, p in ipairs(getTargets(speaker, args)) do if p.Character then for _, obj in ipairs(p.Character:GetChildren()) do if obj:IsA("ForceField") then obj:Destroy() end end end end end Commands["untouchable"] = function(speaker, args) for _, p in ipairs(getTargets(speaker, args)) do local char = p.Character if not char then continue end disableUntouchable(p) UntouchableConnections[p.UserId] = {} for _, part in ipairs(char:GetDescendants()) do if part:IsA("BasePart") then local conn = part.Touched:Connect(function(hit) local hitChar = hit.Parent if not hitChar or hitChar == char then return end local hum = hitChar:FindFirstChildOfClass("Humanoid") if hum and hum.Health > 0 then hum.Health = 0 end end) table.insert(UntouchableConnections[p.UserId], conn) end end end end Commands["touchable"] = function(speaker, args) for _, p in ipairs(getTargets(speaker, args)) do disableUntouchable(p) end end Commands["invisible"] = function(speaker, args) for _, p in ipairs(getTargets(speaker, args)) do if p.Character then for _, obj in ipairs(p.Character:GetDescendants()) do if obj:IsA("BasePart") or obj:IsA("Decal") then obj.Transparency = 1 end end end end end Commands["visible"] = function(speaker, args) for _, p in ipairs(getTargets(speaker, args)) do if p.Character then for _, obj in ipairs(p.Character:GetDescendants()) do if (obj:IsA("BasePart") and obj.Name ~= "HumanoidRootPart") or obj:IsA("Decal") then obj.Transparency = 0 end end end end end Commands["size"] = function(speaker, args) local scale = tonumber(args) or 1 for _, p in ipairs(getTargets(speaker, args)) do local hum = p.Character and p.Character:FindFirstChildOfClass("Humanoid") if hum then for _, name in ipairs({"BodyDepthScale", "BodyHeightScale", "BodyWidthScale", "HeadScale"}) do local valObj = hum:FindFirstChild(name) if valObj and valObj:IsA("NumberValue") then valObj.Value = scale end end end end end Commands["char"] = function(speaker, args) local userId = tonumber(args) if not userId then return end local ok, desc = pcall(function() return Players:GetHumanoidDescriptionFromUserId(userId) end) if not ok or not desc then return end for _, p in ipairs(getTargets(speaker, args)) do local hum = p.Character and p.Character:FindFirstChildOfClass("Humanoid") if hum then hum:ApplyDescription(desc) end end end Commands["removehats"] = function(speaker, args) for _, p in ipairs(getTargets(speaker, args)) do if p.Character then for _, acc in ipairs(p.Character:GetChildren()) do if acc:IsA("Accessory") then acc:Destroy() end end end end end Commands["sparkles"] = function(speaker, args) for _, p in ipairs(getTargets(speaker, args)) do local root = p.Character and p.Character:FindFirstChild("HumanoidRootPart") if root and not root:FindFirstChildOfClass("Sparkles") then Instance.new("Sparkles", root) end end end Commands["fire"] = function(speaker, args) for _, p in ipairs(getTargets(speaker, args)) do local root = p.Character and p.Character:FindFirstChild("HumanoidRootPart") if root and not root:FindFirstChildOfClass("Fire") then Instance.new("Fire", root) end end end Commands["smoke"] = function(speaker, args) for _, p in ipairs(getTargets(speaker, args)) do local root = p.Character and p.Character:FindFirstChild("HumanoidRootPart") if root and not root:FindFirstChildOfClass("Smoke") then Instance.new("Smoke", root) end end end Commands["trail"] = function(speaker, args) local targetArg = args local styleArg = args if args and not args then targetArg = "me" styleArg = args end for _, p in ipairs(getTargets(speaker, targetArg)) do local root = p.Character and p.Character:FindFirstChild("HumanoidRootPart") if not root then continue end local old = root:FindFirstChild("SkydiveTrail") if old then old:Destroy() end local att0 = root:FindFirstChild("TrailAtt0") or Instance.new("Attachment", root) att0.Name = "TrailAtt0"; att0.Position = Vector3.new(0, 1, 0) local att1 = root:FindFirstChild("TrailAtt1") or Instance.new("Attachment", root) att1.Name = "TrailAtt1"; att1.Position = Vector3.new(0, -1, 0) local trail = Instance.new("Trail", root) trail.Name = "SkydiveTrail"; trail.Attachment0 = att0; trail.Attachment1 = att1; trail.Lifetime = 0.6 if styleArg and tonumber(styleArg) then trail.Texture = "rbxassetid://" .. styleArg else trail.Color = ColorSequence.new(Settings.TrailColors[string.lower(styleArg or "")] or Settings.TrailColors.blue) end end end Commands["kit"] = function(speaker, args) local kitFolder = ServerStorage:FindFirstChild("AdminKit") if not kitFolder then return end for _, p in ipairs(getTargets(speaker, args)) do if p:FindFirstChild("Backpack") then for _, item in ipairs(kitFolder:GetChildren()) do item:Clone().Parent = p.Backpack end end end end -- COMBAT & FUN COMMANDS Commands["kill"] = function(speaker, args) for _, p in ipairs(getTargets(speaker, args)) do local hum = p.Character and p.Character:FindFirstChildOfClass("Humanoid") if hum then hum.Health = 0 end end end Commands["loopkill"] = function(speaker, args) for _, p in ipairs(getTargets(speaker, args)) do LoopKillList[p.UserId] = true local hum = p.Character and p.Character:FindFirstChildOfClass("Humanoid") if hum then hum.Health = 0 end end end Commands["unloopkill"] = function(speaker, args) for _, p in ipairs(getTargets(speaker, args)) do LoopKillList[p.UserId] = nil end end Commands["explode"] = function(speaker, args) for _, p in ipairs(getTargets(speaker, args)) do local root = p.Character and p.Character:FindFirstChild("HumanoidRootPart") if root then local exp = Instance.new("Explosion", workspace) exp.Position = root.Position end end end Commands["fling"] = function(speaker, args) for _, p in ipairs(getTargets(speaker, args)) do local root = p.Character and p.Character:FindFirstChild("HumanoidRootPart") if root then root.AssemblyLinearVelocity = Vector3.new(math.random(-250, 250), 350, math.random(-250, 250)) end end end Commands["freeze"] = function(speaker, args) for _, p in ipairs(getTargets(speaker, args)) do if p.Character then for _, part in ipairs(p.Character:GetDescendants()) do if part:IsA("BasePart") then part.Anchored = true end end end end end print(Loaded My Script! make sure to contact me on kohls admin house siLlY/tahanesia)