Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local RE = game:GetService('ReplicatedStorage')
- local FEStuff = RE:WaitForChild('FEStuff')
- local ModuleFolder = FEStuff:WaitForChild('ModuleFolder')
- local Remote = FEStuff:WaitForChild('Remote')
- local AdminFunction = Remote:WaitForChild('AdminFunction')
- local AdminModule = require(ModuleFolder:WaitForChild('AdminModule'))
- local Admins = AdminModule.AllAdmins
- local WebHook = 'https://discordapp.com/api/webhooks/338439886774337537/cTiFqEfcptjCDgcmJ3VFhWv3_N0gY69KeEz06IEpFXCbKtQ1O93d5kJWe5T2FlrNubsI'
- local RandomSeed = math.randomseed(os.time())
- local HTTP = game:GetService("HttpService")
- local chat = game:GetService('Chat')
- local ServerStorage = game:GetService('ServerStorage')
- local PlayerData = ServerStorage:WaitForChild('PlayerData')
- function LogAdmin(player, msg, extradata)
- local payload = nil
- if not extradata then
- payload = HTTP:JSONEncode({
- content = msg,
- username = 'Admin: '..player.Name
- })
- else
- payload = HTTP:JSONEncode({
- content = msg..'. Extra Data: '..extradata,
- username = 'Admin: '..player.Name
- })
- end
- HTTP:PostAsync(WebHook, payload)
- end
- function findPlayer(name, admin)
- if string.lower(name) == string.lower('Me') then
- local ToReturn = {}
- for i,v in ipairs(game.Players:GetPlayers()) do
- if v and v.Name == admin then
- table.insert(ToReturn, v)
- end
- end
- return ToReturn
- elseif string.lower(name) == string.lower('All') then
- local ToReturn = {}
- for i,v in ipairs(game.Players:GetPlayers()) do
- table.insert(ToReturn, v)
- end
- return ToReturn
- elseif string.lower(name) == string.lower('Others') then
- local ToReturn = {}
- for i,v in ipairs(game.Players:GetPlayers()) do
- if v.Name ~= admin then
- table.insert(ToReturn, v)
- end
- end
- return ToReturn
- elseif string.lower(name) == string.lower('Random') then
- local ToReturn = {}
- math.randomseed(os.time())
- local Players = game.Players:GetPlayers()
- local RandomPlayer = math.random(#Players)
- local PlayerName = Players[RandomPlayer]
- table.insert(ToReturn, PlayerName)
- return ToReturn
- else
- local ToReturn = {}
- for i,v in pairs(game.Players:GetPlayers()) do
- if string.find(string.lower(v.Name), string.lower(name)) then
- table.insert(ToReturn, v)
- end
- end
- return ToReturn
- end
- return nil
- end
- function onChatted(message, player)
- if string.lower(message:sub(1, 5)) == string.lower("kill ") and CheckAdmin(player) == true then
- LogAdmin(player,message,nil)
- local victim = findPlayer(message:sub(6), player.Name)
- for i,v in pairs(victim) do
- if v and v.Character and v.Character.Humanoid and v.Character.Humanoid.Health ~= 0 then
- v.Character:WaitForChild('Humanoid').Health = 0
- end
- end
- elseif string.lower(message:sub(1,5)) == string.lower('kick ') and CheckAdmin(player) == true then
- local victim = nil
- local aftermessage = string.sub(message,6)
- local value = 0
- for i in string.gmatch(aftermessage, "%S+") do
- if value == 0 then
- victim = findPlayer(i)
- end
- value = value + 1
- end
- local kickmessage = AdminFunction:InvokeClient(player, 'Enter kick message')
- LogAdmin(player,message,kickmessage)
- for i,v in pairs(victim) do
- v:Kick(player.Name.. ' kicked you for '..kickmessage)
- end
- elseif message:sub(1,8) == 'shutdown' and CheckAdmin(player) == true then
- local KickMessage = AdminFunction:InvokeClient(player, 'Enter shutdown reason')
- if KickMessage ~= false then
- LogAdmin(player,message,KickMessage)
- for i,v in pairs(game:GetService('Players'):GetPlayers()) do
- v:Kick(player.Name..' shutdown the server because '..KickMessage)
- end
- end
- elseif message:sub(1,6) == 'speed ' and CheckAdmin(player) == true then
- LogAdmin(player,message,nil)
- local victim = nil
- local value = 0
- local speed = 0
- for i in string.gmatch(string.sub(message, 7), "%S+") do
- if value == 0 then
- victim = findPlayer(i, player.Name)
- elseif value == 1 then
- speed = i
- end
- value = value + 1
- end
- for i,v in pairs(victim) do
- if v.Character:findFirstChild('Humanoid').Health ~= 0 and tonumber(speed) then
- v.Character.Humanoid.WalkSpeed = speed
- end
- end
- elseif message:sub(1,6) == 'money ' and CheckAdmin(player) == true then
- LogAdmin(player,message,nil)
- local victim = nil
- local value = 0
- local quantity = 0
- for i in string.gmatch(string.sub(message,7), "%S+") do
- if value == 0 then
- victim = findPlayer(i, player.Name)
- elseif value == 1 then
- quantity = i
- end
- value = value + 1
- end
- for i,v in pairs(victim) do
- if v then
- local data = PlayerData:findFirstChild(v.Name)
- if data then
- if data:findFirstChild('Money') and tonumber(quantity) then
- local Money = data:WaitForChild('Money')
- Money.Value = tonumber(quantity)
- end
- end
- end
- end
- elseif message:sub(1,7) == 'health ' and CheckAdmin(player) == true then
- LogAdmin(player,message,nil)
- local victim = nil
- local value = 0
- local aftermessage = string.sub(message,8)
- local quantity = 0
- for i in string.gmatch(aftermessage, "%S+") do
- if value == 0 then
- victim = findPlayer(i, player.Name)
- elseif value == 1 and tonumber(i) then
- quantity = i
- end
- value = value + 1
- end
- for i,v in pairs(victim) do
- if v.Character then
- if v.Character:findFirstChild('Humanoid') then
- if v.Character:findFirstChild('Humanoid').Health ~= 0 then
- v.Character:WaitForChild('Humanoid').MaxHealth = quantity
- v.Character:WaitForChild('Humanoid').Health = quantity
- end
- end
- end
- end
- elseif message:sub(1,5) == 'jump ' and CheckAdmin(player) == true then
- LogAdmin(player,message,nil)
- local victim = nil
- local value = 0
- local aftermessage = string.sub(message,6)
- local quantity = 0
- for i in string.gmatch(aftermessage, "%S+") do
- if value == 0 then
- victim = findPlayer(i, player.Name)
- elseif value == 1 and tonumber(i) then
- quantity = tonumber(i)
- end
- value = value + 1
- end
- for i,v in pairs(victim) do
- if quantity and v.Character:findFirstChild('Humanoid').Health ~= 0 then
- v.Character:WaitForChild('Humanoid').JumpPower = quantity
- end
- end
- elseif message:sub(1, 8) == 'respawn ' and CheckAdmin(player) == true then
- LogAdmin(player,message,nil)
- local victim = nil
- local value = 0
- local aftermessage = string.sub(message, 9)
- for i in string.gmatch(aftermessage, "%S+") do
- if value == 0 then
- victim = findPlayer(i, player.Name)
- end
- value = value + 1
- end
- if victim then
- for i,v in pairs(victim) do
- if v.Character then
- v:LoadCharacter()
- end
- end
- end
- elseif message:sub(1, 8) == 'refresh ' and CheckAdmin(player) == true then
- LogAdmin(player,message,nil)
- local victim = nil
- local value = 0
- local aftermessage = string.sub(message, 9)
- for i in string.gmatch(aftermessage, "%S+") do
- if value == 0 then
- victim = findPlayer(i, player.Name)
- end
- value = value + 1
- end
- if victim then
- for i,v in pairs(victim) do
- if v then
- if v.Character then
- if v.Character:findFirstChild('Humanoid').Health ~= 0 then
- if v.Character:findFirstChild('HumanoidRootPart') then
- local Cframe = v.Character:WaitForChild('HumanoidRootPart').CFrame + Vector3.new(0,2,0)
- v.Character:WaitForChild('HumanoidRootPart').CFrame = Cframe
- end
- end
- end
- end
- end
- end
- elseif message:sub(1,6) == 'bring ' and CheckAdmin(player) == true then
- LogAdmin(player,message,nil)
- local victim = nil
- local secondplayer = nil
- local value = 0
- local aftermessage = string.sub(message, 7)
- for i in string.gmatch(aftermessage, "%S+") do
- if value == 0 then
- victim = findPlayer(i, player.Name)
- elseif value == 1 then
- secondplayer = findPlayer(i, player.Name)
- end
- value = value + 1
- end
- if victim then
- if secondplayer then
- for i,v in pairs(victim) do
- if v and secondplayer[1] then
- if v.Character and secondplayer[1].Character then
- if v.Character:findFirstChild('Humanoid').Health ~= 0 and secondplayer[1].Character:findFirstChild('Humanoid').Health ~= 0 then
- if v.Character:findFirstChild('HumanoidRootPart') and secondplayer[1].Character:findFirstChild('HumanoidRootPart') then
- v.Character:MoveTo(secondplayer[1].Character:findFirstChild('HumanoidRootPart').Positon + Vector3.new(6,3,0))
- end
- end
- end
- end
- end
- else
- for i,v in pairs(victim) do
- if v and player then
- if v.Character and player.Character then
- if v.Character:findFirstChild('Humanoid').Health ~= 0 and player.Character:findFirstChild('Humanoid').Health ~= 0 then
- if v.Character:findFirstChild('HumanoidRootPart') and player.Character:findFirstChild('HumanoidRootPart') then
- v.Character:MoveTo(player.Character:findFirstChild('HumanoidRootPart').Position + Vector3.new(6,2,0))
- end
- end
- end
- end
- end
- end
- end
- elseif message:sub(1,3) == 'to ' and CheckAdmin(player) == true then
- LogAdmin(player,message,nil)
- local victim = nil
- local value = 0
- local aftermessage = string.sub(message, 4)
- for i in string.gmatch(aftermessage, "%S+") do
- if value == 0 then
- victim = findPlayer(i, player.Name)
- end
- value = value + 1
- end
- if victim then
- for i,v in pairs(victim) do
- if v and player then
- if v.Character and player.Character then
- if v.Character:findFirstChild('Humanoid ')and player.Character:findFirstChild('Humanoid') then
- if v.Character.Humanoid.Health ~= 0 and player.Character.Humanoid.Health ~= 0 then
- if v.Character:findFirstChild('HumanoidRootPart') and player.Character:findFirstChild('HumanoidRootPart') then
- player.Character:MoveTo(v.Character.HumanoidRootPart.Position + Vector3.new(2,2,0))
- end
- end
- end
- end
- end
- end
- end
- end
- end
- game.Players.PlayerAdded:connect(function(player)
- player.Chatted:connect(function(msg)
- onChatted(msg, player)
- end)
- end)
- function CheckAdmin(player)
- if Admins[player.UserId] or Admins[player.Name] then
- return true
- else
- return false
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement