100% found this document useful (1 vote)
2K views2 pages

Roblox Admin Script

This script contains admin commands for a Roblox game. It defines admin users, checks if players are banned on join, and includes commands like /kill, /heal, /kick, /ban, and /unban that admins can use via chat. These commands allow admins to kill, heal, kick, ban, or unban other players based on their message. A DataStore is used to track banned players by user ID.
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
100% found this document useful (1 vote)
2K views2 pages

Roblox Admin Script

This script contains admin commands for a Roblox game. It defines admin users, checks if players are banned on join, and includes commands like /kill, /heal, /kick, /ban, and /unban that admins can use via chat. These commands allow admins to kill, heal, kick, ban, or unban other players based on their message. A DataStore is used to track banned players by user ID.
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
You are on page 1/ 2

--//Admin Commands Script

--//Variables\\--
local DataStore = game:GetService("DataStoreService")
local BanList = DataStore:GetDataStore("BanList")
local Admins = {"ConectedDeleted_666", "Mineloxer"} --//People who you want as
admins

--//Events\\--
game.Players.PlayerAdded:connect(function(Player)
local Folder = Instance.new("Folder", Player)
Folder.Name = "PlayerValues"

local BanCheck = Instance.new("BoolValue", Folder)


BanCheck.Name = "IsBanned"
BanCheck.Value = BanList:GetAsync(Player.userId) or false --//False is
default if no save for the player

--//Checks if the player is banned or not


if Player.PlayerValues.IsBanned.Value == true then
Player:Kick("You're Banned") --//Reason for kick
end

Player.Chatted:connect(function(message)
for i, AdminName in ipairs(Admins) do
if Player.Name == AdminName then
--//Commands\\--
--//Kill Command
if message:sub(1, 6) == "/kill " then
local TargetPlayer =
game.Players:FindFirstChild(message:sub(7))
if TargetPlayer then
local Character = TargetPlayer.Character
if Character then
Character.Humanoid.Health = 0
end
end
end

--//Heal Command
if message:sub(1, 6) == "/heal " then
local TargetPlayer =
game.Players:FindFirstChild(message:sub(7))
if TargetPlayer then
local Character = TargetPlayer.Character
if Character then
Character.Humanoid.Health =
Character.Humanoid.MaxHealth
end
end
end

--//Kick Command
if message:sub(1, 6) == "/kick " then
local TargetPlayer =
game.Players:FindFirstChild(message:sub(7))
if TargetPlayer then
TargetPlayer:Kick("Kicked by " .. Player.Name)
--//Kick message/reason
end
end

--//Ban Command
if message:sub(1, 5) == "/ban " then
local TargetPlayer =
game.Players:FindFirstChild(message:sub(6))
if TargetPlayer then
local BanCheck =
TargetPlayer.PlayerValues.IsBanned
if BanCheck then
BanCheck.Value = true
BanList:SetAsync(TargetPlayer.userId,
true)
end
TargetPlayer:Kick("You've been banned by " ..
Player.Name) --//Reason || Message
end
end

--//Unban Command
if message:sub(1, 7) == "/unban " then --//USES ID NOT NAME
local UserId = tonumber(message:sub(8))
if UserId then
BanList:SetAsync(UserId, false)
end
end
break
end
end
end)
end)

You might also like