Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local plrz = game.Players:GetPlayers()
- local loops = {}
- local owners = {"InfinityEngine", "TimothyGroveiscool2", "KerinFTWA"}
- local commands = {
- "kill",
- }
- local banned = {}
- local prefix = "~"
- function checkAdmin(plr)
- for i,v in pairs(owners) do
- if v:lower() == plr.Name:lower() then
- return true
- end
- end
- return false
- end
- function checkBan(plr)
- for i,v in pairs(banned) do
- if v:lower() == plr.Name:lower() then
- return true
- end
- end
- return false
- end
- function getCommand(message)
- if message:sub(0,1) == prefix then
- message = message:sub(2)
- print(message)
- return message
- end
- return nil
- end
- function getTarget(str, player)
- str = str:gsub("%s+", "")
- local commas = {0}
- local targetStr = {}
- local targetted = {}
- for i=1,str:len(),1 do if str:sub(i,i) == "," then table.insert(commas, i) end end table.insert(commas, str:len()+1)
- for i=2,#commas do table.insert(targetStr, str:sub(commas[i-1]+1, commas[i]-1)) end
- for i,name in pairs(targetStr) do
- if name == "all" then
- targetted = plrz
- break
- elseif name == "others" then
- for i,v in pairs(plrz) do
- if v ~= player then
- table.insert(targetted, v)
- end
- end
- break
- elseif name == "me" then
- table.insert(targetted, player)
- else
- for i,v in pairs(plrz) do
- if v.Name:lower():find(name) then
- table.insert(targetted, v)
- end
- end
- end
- end
- return targetted
- end
- function checkCommand(msg, player)
- msg = msg:lower()
- if msg:sub(1,5) == "kill " then
- local plrs = getTarget(msg:sub(6), player)
- for i,v in pairs(plrs) do
- local char = v.Character
- char:WaitForChild("Humanoid").Health = 0
- end
- end
- --[[if msg:sub(1,4) == "fly " then
- local plrs = getTarget(msg:sub(5), player)
- for i,v in pairs(plrs) do
- local flyScript = script.fly:clone()
- flyScript.Parent = v.PlayerGui
- flyScript.Disabled = false
- end
- end]]
- if msg:sub(1,6) == "speed " then
- local speed, plrs
- local chk1 = msg:sub(7):find(" ")
- if chk1 then
- plrs = getTarget(msg:sub(7, chk1+5), player)
- speed = tonumber(msg:sub(chk1+7))
- for i,v in pairs(plrs) do
- local char = v.Character
- if char.Humanoid then
- char.Humanoid.WalkSpeed = speed
- end
- end
- end
- end
- if msg:sub(1,4) == "god " then
- local plrs = getTarget(msg:sub(5), player)
- for i,v in pairs(plrs) do
- v.Character.Humanoid.Health = 9e9
- end
- end
- if msg:sub(1,5) == "give " then
- local plrs, id
- local chk1 = msg:sub(6):find(" ")
- if chk1 then
- plrs = getTarget(msg:sub(6, chk1+4), player)
- id = tonumber(msg:sub(chk1+7), player)
- for i,v in pairs(plrs) do
- end
- end
- end
- if msg:sub(1,5) == "kick " then
- local reason, plrs
- local chk1 = msg:sub(6):find(" ")
- if chk1 then
- plrs = getTarget(msg:sub(6, chk1+4), player)
- reason = msg:sub(chk1+6)
- for i,v in pairs(plrs) do
- v:Kick(reason)
- end
- else
- plrs = getTarget(msg:sub(6), player)
- for i,v in pairs(plrs) do
- v:Kick("You were kicked")
- end
- end
- end
- if msg:sub(1,4) == "ban " then
- local reason, plrs
- local chk1 = msg:sub(5):find(" ")
- if chk1 then
- plrs = getTarget(msg:sub(5, chk1+3), player)
- reason = msg:sub(chk1+5)
- for i,v in pairs(plrs) do
- table.insert(banned, v.Name)
- v:Kick(reason)
- end
- else
- plrs = getTarget(msg:sub(5), player)
- for i,v in pairs(plrs) do
- table.insert(banned, v.Name)
- v:Kick("You were banned")
- end
- end
- end
- if msg:sub(1,5) == "rain " then
- local rainType, rainSize
- local chk1 = msg:sub(6):find(" ")
- if chk1 then
- rainType = msg:sub(6, chk1+4)
- rainSize = tonumber(msg:sub(chk1+6))
- else
- rainType = msg:sub(6)
- rainSize = 10
- end
- if rainType:lower() == "blocks" then
- math.randomseed(tick())
- local newLoop = Instance.new("BoolValue")
- local loopIndex = #loops+1
- newLoop.Value = true
- loops[loopIndex] = newLoop
- coroutine.resume(coroutine.create(function()
- while wait() and loops[loopIndex].Value do
- local p = Instance.new("Part", workspace)
- p.Size = Vector3.new(rainSize, rainSize, rainSize)
- p.Position = Vector3.new(math.random(-rainSize*5, rainSize*5), rainSize*5, math.random(-rainSize*5, rainSize*5))
- p.BrickColor = BrickColor.Random()
- end
- end))
- end
- end
- if msg:sub(1,11) == "breaklimbs " then
- local plrs = getTarget(msg:sub(12), player)
- for i,v in pairs(plrs) do
- local char = v.Character
- char.Humanoid.HipHeight = 0.05
- for i,v in pairs(char:GetChildren()) do
- if v.Name == "RightUpperArm" or v.Name == "Right Arm" then
- v:remove()
- elseif v.Name == "LeftUpperArm" or v.Name == "Left Arm" then
- v:remove()
- elseif v.Name == "RightUpperLeg" or v.Name == "Right Leg" then
- v:remove()
- elseif v.Name == "LeftUpperLeg" or v.Name == "Left Leg" then
- v:remove()
- end
- end
- end
- end
- if msg:sub(1,6) == "invis " then
- local plrs = getTarget(msg:sub(7), player)
- for i,v in pairs(plrs) do
- local char = v.Character
- char.Head.face.Transparency = 1
- for a,p in pairs(char:GetChildren()) do
- if p:IsA("BasePart") then
- p.Transparency = 1
- elseif p:IsA("Hat") or p:IsA("Accessory") then
- p.Handle.Transparency = 1
- end
- end
- end
- end
- if msg:sub(1,8) == "uninvis " then
- local plrs = getTarget(msg:sub(9), player)
- for i,v in pairs(plrs) do
- local char = v.Character
- char.Head.face.Transparency = 0
- for a,p in pairs(char:GetChildren()) do
- if p:IsA("BasePart") then
- p.Transparency = 0
- elseif p:IsA("Hat") or p:IsA("Accessory") then
- p.Handle.Transparency = 0
- end
- end
- char.HumanoidRootPart.Transparency = 1
- end
- end
- if msg:sub(1,8) == "gravity " then
- local gravitySetting = tonumber(msg:sub(9))
- if msg:sub(9):lower() == "normal" then gravitySetting = 196.2 end
- workspace.Gravity = gravitySetting
- end
- if msg:sub(1,9) == "loopkill " then
- local plrs = getTarget(msg:sub(10), player)
- local newLoop = Instance.new("BoolValue")
- local loopIndex = #loops+1
- newLoop.Value = true
- loops[loopIndex] = newLoop
- for i,v in pairs(plrs) do
- coroutine.resume(coroutine.create(function()
- while wait() and loops[loopIndex].Value do
- if v.Character then
- v.Character:BreakJoints()
- wait(5.5)
- end
- end
- end))
- end
- end
- if msg:sub(1,6) == "music " then
- for i,v in pairs(workspace:GetChildren()) do
- if v:IsA("Sound") then
- v:remove()
- end
- end
- local sound = Instance.new("Sound", workspace)
- sound.SoundId = "rbxassetid://"..msg:sub(7)
- sound.Looped = true
- sound.Volume = 1
- sound:Play()
- end
- if msg:sub(1,11) == "removemusic" then
- for i,v in pairs(workspace:GetChildren()) do
- if v:IsA("Sound") then
- v:remove()
- end
- end
- end
- if msg:sub(1,11) == "removeloops" then
- for i,v in pairs(loops) do
- v.Value = false
- end
- end
- end
- game.Players.PlayerAdded:connect(function(player)
- plrz = game.Players:GetPlayers()
- local banned = checkBan(player)
- local admin = checkAdmin(player)
- if banned then
- player:Kick("You are banned.")
- end
- if admin then
- player.Chatted:connect(function(message)
- local command = getCommand(message)
- if command then
- checkCommand(command, player)
- end
- end)
- end
- end)
- game.Players.PlayerRemoving:connect(function()
- plrz = game.Players:GetPlayers()
- end)
- local Owner = nil
- repeat wait() for i,v in pairs(game.Players:GetPlayers()) do local isAdmin = checkAdmin(v) if isAdmin then Owner = v end end until Owner
- print("Found owner: " .. Owner.Name)
- Owner.Chatted:connect(function(message)
- local command = getCommand(message)
- if command then
- checkCommand(command, Owner)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement