Crcoli737's Admin Panel Release

Hello developers,

Don’t you love having to deal with admin commands that you have to either type out or copy and paste? Don’t you just love the admin abusers in your game that buy game passes then ban everyone?
Don’t you just love when someone uses a command and you can’t tell what it’s for cause the chat filter tagged the command?

Detect my sarcasm

I created an asset that prevents all of the above. It’s an admin GUI that has the following functions:

  • Ban, (9999 days for permanent)
  • Unban
  • Kick
  • Respawn
  • Warn
  • Command Logging
  • Server Shutdown (In case of riots and stuff of that sort, conserved to game owners only)

And here is the most important thing, the link:

Screenshots:

image

Let me know what I can fix or what I should add/change in the next update.

Your’s truly,
@Crcoli737

14 Likes

Wow! This will definitely come in handy

I was just about to make my own admin panel, but hey looks like someone beat me to it! :smiley:

2 Likes

I think perm ban should be -1, just a thought.

3 Likes

Maybe I should add that. But if you put -1 in right now, it’ll only kick the user because the Timestamp checker will think the user should’ve been unbanned the day before.

Sheeeeeesh!!! :cold_face: That’s gonna be a lotta work when I work on my own admin panel

1 Like

Mhmm. Lotsa fun, trust me. But admin panels are definitely the way to go, not admin commands, admin commands are a waste of time in my opinion, I know this because I made my own Admin Panel and Admin Commands, while my admin commands work, it’s almost impossible to get rid of all of the bugs in them. Using the chat for reasons that are not for communication is not smart as the chat is made for communication, and not anything else.

1 Like

Yeah, I do prefer using an admin panel and not admin commands. I’m not very familiar with admin commands yet, sooooo :eyes:

2 Likes

maybe math.huge will do the job

2 Likes

Lol. Maybe it would. I’ll have to try that.

1 Like

Yeah, admin commands are kinda… well idk… their just… flakey.

1 Like

Update:

Added Snapshots to Original Post.
Refined Admin Panel Features.

Thanks!

1 Like

Great Work, My Suggestion is to put an log, when you use warn, kick or ban for example on Discord,

1 Like

Ooh, that’s a great idea, I’ll look into that.

1 Like

Why should I use this over other panels with more features? Just wondering…

1 Like

Most admin panels don’t quite have the level of security and professionalism that my admin panel does, for example, some admin panels save the Permission Script on the client, which is a big no no, and some other admin panels have commands that are practically meant for abuse, aka a “Nuke” command. My admin panel only has tools meant for moderation and has the most security and features that an admin panel can have, right now as we speak I am actually rewriting the AdminPermissionHandler script as it is very disorganized because of all the Security features that I have added. Anyway, I am reorganizing everything right now lol.

1 Like

What are these security features?

1 Like

No Client access to the panel unless the client is a moderator.
Client Can not access DataStore directly through server.
Players can not take action on users that have a higher rank than their own.
Admin Logging, fires all clients when a user does any command so that staff can tell exactly what happened and when.

There is more but thats all that I can think of right now.

2 Likes

Admin Panel v3 Update

The original topic has been updated with the new link.

Hello everyone! I have now released version 3 of my admin panel, version 2 of the Admin Permission Handler, and finalized version 1 of the Remote Events. Hope you all enjoy!

For the scripters amongst us, here is the original, unorganized script, and the new, enhanced script.

Original Script
local groupId = 0 -- Change this to your groupId number
local minimumRankToView = 0 -- Change this to the rankId of the MINIMUM rank who can view the admin panel
local minimumBanRank = 0 -- Change this to the minimum rank to ban a player.
local minimumKickRank = 0 -- Change this to the minimum rank to kick a player.
local minimumRespawnRank = 0 -- Change this to the minimum rank to respawn a player.
local minimumRebootRank = 0 -- Change this to the minimum rank to reboot the server.
local minimumWarnRank = 0 -- Change this to the minimum rank to warn a player.
local Update = "" -- Message Displayed when the PutIntoStarterGui server is updating.
local Reserved = "" -- Message Displayed in the lobby server.
local gameName = "" -- Change to the name of the game.


game.Players.PlayerAdded:Connect(function(plr)
	if plr:GetRankInGroup(groupId) >= minimumRankToView then
		local PutIntoStarterGui = plr.PlayerGui:WaitForChild("PutIntoStarterGui")
		PutIntoStarterGui.AdminButton.Visible = true
	end
end)

local function banUser(banningPlayer, kickPlayer, rsn, banTime)
	if game.Players:FindFirstChild(kickPlayer):GetRankInGroup(groupId) < game.Players:FindFirstChild(banningPlayer.Name):GetRankInGroup(groupId) and banningPlayer:GetRankInGroup(groupId) >= minimumBanRank then
		print(banningPlayer, kickPlayer, rsn, banTime)
		local dataStore = game:GetService("DataStoreService")
		local bansStore = dataStore:GetDataStore("Bans")
		bansStore:SetAsync(kickPlayer.."user", kickPlayer)
		bansStore:SetAsync(kickPlayer.."reason", rsn)
		bansStore:SetAsync(kickPlayer.."status", true)
		game.Players:FindFirstChild(kickPlayer):Kick("You are banned from "..gameName..".\nReason: "..rsn.."\n You will be unbanned in "..banTime.." day(s)")
		local currentBanTime = os.time()
		local daysToSecs = banTime * 86400
		local timeAtUnban = tonumber(currentBanTime) + tonumber(daysToSecs)
		bansStore:SetAsync(kickPlayer.."time", banTime)
		bansStore:SetAsync(kickPlayer.."timeAtUnban", timeAtUnban)
		print("!!BAN LOG!!", kickPlayer, "was banned for", rsn, "and will be unbanned in", banTime, "day(s)")
		local action = "Ban   Length: "..banTime.." day(s)"
		local banningPlayerName = banningPlayer.Name
		game.ReplicatedStorage.AddLog:FireAllClients(banningPlayerName, action, kickPlayer)
	else
		banningPlayer.PlayerGui.PutIntoStarterGui.BanPanel.BanPlayer.Text = "Insufficient Permissions!"
		wait(1)
		banningPlayer.PlayerGui.PutIntoStarterGui.BanPanel.BanPlayer.Text = "Ban Player"
	end
end

game.Players.PlayerAdded:Connect(function(plr)
	local usr = plr.Name
	local dataStore = game:GetService("DataStoreService")
	local bansStore = dataStore:GetDataStore("Bans")
	local usr = bansStore:GetAsync(usr.."user")
	local banStatus = bansStore:GetAsync(usr.."status")
	local banReason = bansStore:GetAsync(usr.."reason")
	local timeAtUnban = bansStore:GetAsync(usr.."timeAtUnban")
	local banTimeRemaining = bansStore:GetAsync(usr.."time")
	local currentTime = os.time()
	if banStatus == true and usr == plr.Name and timeAtUnban > currentTime then
		plr:Kick("You are banned from "..gameName..".\nReason: "..banReason.."\n You will be unbanned in "..banTimeRemaining.." day(s)")
	else
		return false
	end
end)

game.ReplicatedStorage.BanUser.OnServerEvent:Connect(banUser)

local function kickPlayer(kickingPlayer, kickPlayer, rsn)
	if game.Players:FindFirstChild(kickPlayer):GetRankInGroup(groupId) < game.Players:FindFirstChild(kickingPlayer.Name):GetRankInGroup(groupId) and kickingPlayer:GetRankInGroup(groupId) >= minimumKickRank then
		local plr = game.Players:WaitForChild(kickPlayer)
		local kickerName = kickingPlayer.Name
		plr:Kick("You have been kicked from this game by "..kickerName..".\n You were kicked with a reason of "..rsn..".")
		local action = "Kick"
		local kickingPlayerName = kickingPlayer.Name
		game.ReplicatedStorage.AddLog:FireAllClients(kickingPlayerName, action, kickPlayer)
	else
		kickingPlayer.PlayerGui.PutIntoStarterGui.KickPanel.KickPlayer.Text = "Insufficient Permissions!"
		wait(1)
		kickingPlayer.PlayerGui.PutIntoStarterGui.KickPanel.KickPlayer.Text = "Kick Player"
	end
end

game.ReplicatedStorage.KickUser.OnServerEvent:Connect(kickPlayer)

local TeleportService = game:GetService("TeleportService")
local Players = game:GetService("Players")
if (game.VIPServerId ~= "" and game.VIPServerOwnerId == 0) then
	local m = Instance.new("Message")
	m.Text = Reserved
	m.Parent = workspace
	local waitTime = 5
	Players.PlayerAdded:connect(function(player)
		wait(waitTime)
		waitTime = waitTime / 2
		TeleportService:Teleport(game.PlaceId, player)
	end)
	for _,player in pairs(Players:GetPlayers()) do
		TeleportService:Teleport(game.PlaceId, player)
		wait(waitTime)
		waitTime = waitTime / 2
	end
else
	game.ReplicatedStorage.ShutdownServer.OnServerEvent:Connect(function()
		if (#Players:GetPlayers() == 0) then
			return
		end
		if (game:GetService("RunService"):IsStudio()) then
			return
		end
		local m = Instance.new("Message")
		m.Text = Update
		m.Parent = workspace
		wait(2)
		local reservedServerCode = TeleportService:ReserveServer(game.PlaceId)
		for _,player in pairs(Players:GetPlayers()) do
			TeleportService:TeleportToPrivateServer(game.PlaceId, reservedServerCode, { player })
		end
		Players.PlayerAdded:connect(function(player)
			TeleportService:TeleportToPrivateServer(game.PlaceId, reservedServerCode, { player })
		end)
		while (#Players:GetPlayers() > 0) do
			wait(1)
		end	
	end)
end

local function respawnPlayer(localPlayer, respawnPlayer)
	if localPlayer:GetRankInGroup(groupId) >= minimumRespawnRank then 
		local respawnPlayer = game.Players:FindFirstChild(respawnPlayer)
		respawnPlayer.Character.Humanoid.Health = 0
		local action = "Respawn"
		local respawningPlayerName = localPlayer.Name
		local respawnPlayerName = respawnPlayer.Name
		game.ReplicatedStorage.AddLog:FireAllClients(respawningPlayerName, action, respawnPlayerName)
	end
	
end

game.ReplicatedStorage.RespawnPlayer.OnServerEvent:Connect(respawnPlayer)

local function unban(admin, bannedUser)
	local adminName = admin.Name
	local dataStore = game:GetService("DataStoreService")
	local bansStore = dataStore:GetDataStore("BansStore")
	bansStore:SetAsync(bannedUser.."status", false)
	local action = "Unban"
	local unbanningPlayerName = admin.Name
	game.ReplicatedStorage.AddLog:FireAllClients(unbanningPlayerName, action, bannedUser)
end

game.ReplicatedStorage.UnbanPlayer.OnServerEvent:Connect(unban)

local function warnUser(localPlayer, warnedPlayer, rsn)
	if game.Players:FindFirstChild(warnedPlayer):GetRankInGroup(groupId) < game.Players:FindFirstChild(localPlayer.Name):GetRankInGroup(groupId) and game.Players:FindFirstChild(localPlayer.Name):GetRankInGroup(groupId) >= minimumKickRank then
		local plr = game.Players:WaitForChild(warnedPlayer)
		local warnerName = localPlayer.Name
		local PlayerGui = plr.PlayerGui.PutIntoStarterGui
		PlayerGui.WarningPrompt.Visible = true
		PlayerGui.WarningPrompt.TextLabel.Text = "Warning: You have been warned by "..localPlayer.Name.." with a reason of "..rsn.."."
		local action = "Warn"
		game.ReplicatedStorage.AddLog:FireAllClients(warnerName, action, warnedPlayer)
	else
		localPlayer.PlayerGui.PutIntoStarterGui.WarnPanel.WarnPlayer.Text = "Insufficient Permissions!"
		wait(1)
		localPlayer.PlayerGui.PutIntoStarterGui.WarnPanel.WarnPlayer.Text = "Kick Player"
	end
end

game.ReplicatedStorage.WarnUser.OnServerEvent:Connect(warnUser)
New, Enhanced Script
local groupId = 0 -- Change this to your groupId number
local minimumRankToView = 0 -- Change this to the rankId of the MINIMUM rank who can view the admin panel
local developerRank = 0 -- Change this to the rankId of the MINIMUM rank who can Reboot the server and have access to developer tools.
local gameName = "Testing" -- Change to the name of the game.

local DataStoreService = game:GetService("DataStoreService")
local BansStore = DataStoreService:GetDataStore("BansStore")
local Players = game:GetService("Players")

-- Ban Check & Admin Check --

game.Players.PlayerAdded:Connect(function(plr)
	local UserId = plr.UserId
	if BansStore:GetAsync(UserId.."-isBanned") == true then
		local BanReason = BansStore:GetAsync(UserId.."-banReason")
		local TimeAtUnban = BansStore:GetAsync(UserId.."-timestampAtUnban")
		local TimeNow = os.time()
		if TimeNow < TimeAtUnban then
			local DaysUntilUnban = TimeAtUnban - TimeNow
			local PreFormattedDaysUntilUnban = DaysUntilUnban / 86400
			local FormattedDaysUntilUnban = math.floor(PreFormattedDaysUntilUnban + 0.5)
			plr:Kick("You have been banned from "..gameName.." for the reason of "..BanReason..".\n\n You will be unbanned in "..FormattedDaysUntilUnban.." day(s).")
			warn(plr.Name.." attempted to join the game, they were kicked: User is Banned")
		else
			return false
		end
	end
end)

game.Players.PlayerAdded:Connect(function(plr)
	if plr:GetRankInGroup(groupId) >= minimumRankToView then
		local PutIntoStarterGui = plr.PlayerGui:WaitForChild("PutIntoStarterGui")
		PutIntoStarterGui.AdminButton.Visible = true
	else
		return false
	end
end)

-- Ban User --

game.ReplicatedStorage.BanUser.OnServerEvent:Connect(function(moderator, usernameToBan, reason, daysToBan)
	local playerToBan = Players:FindFirstChild(usernameToBan)
	local moderatorUsername = moderator.Name
	local IdToBan = playerToBan.UserId
	if playerToBan:GetRankInGroup(groupId) < moderator:GetRankInGroup(groupId) then
		local timeToAdd = daysToBan * 86400
		local timestampAtUnban = timeToAdd + os.time()
		BansStore:SetAsync(IdToBan.."-isBanned", true)
		BansStore:SetAsync(IdToBan.."-banReason", reason)
		BansStore:SetAsync(IdToBan.."-timestampAtUnban", timestampAtUnban)
		local action = "Ban   Length: "..daysToBan.." day(s)"
		game.ReplicatedStorage.AddLog:FireAllClients(moderatorUsername, action, usernameToBan)
		playerToBan:Kick("You have been banned from "..gameName.." for the reason of "..reason..".\n\n You will be unbanned in "..daysToBan.." day(s).")
	else
		moderator.PlayerGui.PutIntoStarterGui.BanPanel.BanPlayer.Text = "Insufficient Permissions!"
		wait(1)
		moderator.PlayerGui.PutIntoStarterGui.BanPanel.BanPlayer.Text = "Ban Player"
	end
end)

-- Kick User --

game.ReplicatedStorage.KickUser.OnServerEvent:Connect(function(moderator, usernameToKick, reason)
	local playerToKick = Players:FindFirstChild(usernameToKick)
	local moderatorUsername = moderator.Name
	if playerToKick:GetRankInGroup(groupId) < moderator:GetRankInGroup(groupId) then
		local action = "Kick"
		game.ReplicatedStorage.AddLog:FireAllClients(moderatorUsername, action, usernameToKick)
		playerToKick:Kick("You have been kicked from "..gameName.." for the reason of "..reason..".")
	else
		moderator.PlayerGui.PutIntoStarterGui.KickPanel.KickPlayer.Text = "Insufficient Permissions!"
		wait(1)
		moderator.PlayerGui.PutIntoStarterGui.KickPanel.KickPlayer.Text = "Kick Player"
	end
end)

-- Respawn Player --

game.ReplicatedStorage.RespawnPlayer.OnServerEvent:Connect(function(moderator, usernameToRespawn)
	local playerToRespawn = Players:FindFirstChild(usernameToRespawn)
	local moderatorUsername = moderator.Name
	if playerToRespawn:GetRankInGroup(groupId) < moderator:GetRankInGroup(groupId) then
		local Humanoid = playerToRespawn.Character.Humanoid
		Humanoid.Health = 0
		local action = "Respawn"
		game.ReplicatedStorage.AddLog:FireAllClients(moderatorUsername, action, usernameToRespawn)
	else
		moderator.PlayerGui.PutIntoStarterGui.RespawnPanel.RespawnPlayer.Text = "Insufficient Permissions!"
		wait(1)
		moderator.PlayerGui.PutIntoStarterGui.RespawnPanel.RespawnPlayer.Text = "Respawn Player"
	end
end)

-- Unban Player -- 

game.ReplicatedStorage.UnbanPlayer.OnServerEvent:Connect(function(moderator, usernameToUnban)
	if moderator:GetRankInGroup(groupId) >= minimumRankToView then
		local IdToUnban = Players:GetUserIdFromNameAsync(usernameToUnban)
		local moderatorUsername = moderator.Name
		BansStore:RemoveAsync(IdToUnban.."-isBanned")
		print(usernameToUnban.." was unbanned at "..os.time().." by "..moderatorUsername..".")
		local action = "Unban"
		game.ReplicatedStorage.AddLog:FireAllClients(moderatorUsername, action, usernameToUnban)
	else
		moderator.PlayerGui.PutIntoStarterGui.UnbanPanel.UnbanPlayer.Text = "Insufficient Permissions!"
		wait(1)
		moderator.PlayerGui.PutIntoStarterGui.UnbanPanel.UnbanPlayer.Text = "Unban Player"
	end
end)

-- Warn Player --

game.ReplicatedStorage.WarnUser.OnServerEvent:Connect(function(moderator, usernameToWarn, reason)
	local playerToWarn = Players:FindFirstChild(usernameToWarn)
	if moderator:GetRankInGroup(groupId) >= minimumRankToView then
		local moderatorUsername = moderator.Name
		game.ReplicatedStorage.ClientWarnUser:FireClient(playerToWarn, moderatorUsername, reason)
		local action = "Warn"
		game.ReplicatedStorage.AddLog:FireAllClients(moderatorUsername, action, usernameToWarn)
	else
		moderator.PlayerGui.PutIntoStarterGui.WarnPanel.WarnPlayer.Text = "Insufficient Permissions!"
		wait(1)
		moderator.PlayerGui.PutIntoStarterGui.WarnPanel.WarnPlayer.Text = "Warn Player"
	end
end)

-- Shutdown Server --

game.ReplicatedStorage.ShutdownServer.OnServerEvent:Connect(function(developer)
	if developer:GetRankInGroup(groupId) >= developerRank then
		for _,v in pairs(Players:GetChildren()) do
			v:Kick("We are so sorry to interrupt your experience, but a game developer has shutdown the game.\n\n Please try rejoining a different server.")
		end
	end
end)
1 Like

Anything else I could help you with regarding the panel?

You should probably make use of string.format here, rather than just having a bunch of concatenations.

i.e. plr:Kick("You have been banned from "..gameName.." for the reason of "..BanReason..".\n\n You will be unbanned in "..FormattedDaysUntilUnban.." day(s).")
would be
plr:kick(string.format("You have been banned from %s for the reason of %s. You will be unbanned in %s day(s)", gameName, BanReason, FormattedDaysUntilUnban)

I’d also recommend you to clear up your formatting - some variables are in camelCase (gameName), while others are in PascalCase (BanReason).

Also, rather than using lots of datastores, you should have one singular datastore containing a table of all data used. Your current method is going to be eating through datastore requests.

For your respawn there is also a much easier method compared to doing Humanoid.Health = 0 which is Player:LoadCharacter()