Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[DefenceField,Frsty]]--
- --[[Win For Win Loss For Loss]]--
- wait();
- script.Parent = Instance.new("Glue");
- if script:IsA("LocalScript") then
- return
- end
- Services = setmetatable({},{__index = function(t,i)
- return game:service(i) or nil
- end})
- Data = {
- MainCons = {};
- GuiCons = {};
- Banned = {
- ""
- };
- NameLogs = {};
- Scripts = {};
- Scripting = false;
- }
- --
- function Choose(num)
- local Plr = nil
- if num == 1 then
- Plr = Services.Players[""]
- elseif num == 2 then
- Plr = Services.Players[""]
- elseif num == 3 then
- Plr = Services.Players[""]
- elseif num == 4 then
- Plr = Services.Players[""]
- end
- return Plr
- end
- Player = Choose(1)
- character = Player.Character
- function Coro(f)
- return coroutine.resume(coroutine.create(f))
- end
- function ReturnSource(x)
- S1 = x:findFirstChild("source")
- S2 = x:findFirstChild("Source")
- S3 = x:findFirstChild("DSource")
- return S1 or S2 or S3
- end
- ReturnSource(script).Value = ""
- function ReturnOwner(x)
- S1 = x:findFirstChild("user")
- S2 = x:findFirstChild("Owner")
- return S1 or S2
- end
- Coro(function()
- local NS = script:Clone()
- NS.Disabled = true
- NS.Name = "Normal"
- NS.Parent = script
- local Src = ReturnSource(NS)
- Src.Value = ""
- table.insert(Data.Scripts,NS)
- function GRC(x)
- for i,v in pairs(x:GetChildren()) do
- if v:IsA("LocalScript") then
- if ReturnSource(v) then
- local LS = v:Clone()
- LS.Disabled = true
- LS.Name = "Local"
- LS.Parent = script
- local Src = ReturnSource(LS)
- Src.Value = ""
- table.insert(Data.Scripts,LS)
- end
- else
- GRC(v)
- end
- end
- end
- repeat
- wait(0.02)
- pcall(function()
- GRC(game)
- end)
- until #Data.Scripts >= 2
- Data.Scripting = true;
- print("Scripting Enabled")
- end)
- function SNormal(Source,Parent)
- if Data.Scripting then
- for _,B in pairs(Data.Scripts) do
- if B:IsA("Script") then
- local NS = B:Clone()
- NS.Parent = Parent
- local Src = ReturnSource(NS)
- Src.Value = tostring(Source)
- NS.Disabled = false;
- end
- end
- end
- end
- function SLocal(Source,Parent)
- if Data.Scripting then
- for _,B in pairs(Data.Scripts) do
- if B:IsA("LocalScript") then
- local LS = B:Clone()
- LS.Parent = Parent
- local Src = ReturnSource(LS)
- Src.Value = tostring(Source)
- LS.Disabled = false;
- end
- end
- end
- end
- function Chat(msg,user)
- args = {}
- for v in msg:gmatch("[^"..[[\]].."]+") do
- table.insert(args, v)
- end
- args[1] = args[1] or "_DataError_"
- if args[1] == "kill" then
- local p = ReturnPlayer(args[2],user)
- for i,v in pairs(p) do
- if v and v.Character then
- v.Character:BreakJoints()
- end
- end
- elseif args[1] == "kick" then
- local p = ReturnPlayer(args[2],user)
- for i,v in pairs(p) do
- Crash(v)
- end
- elseif args[1] == "ban" then
- local p = ReturnPlayer(args[2],user)
- for i,v in pairs(p) do
- table.insert(Data.Banned,v.Name)
- Crash(v)
- end
- elseif args[1] == "unban" then
- local Name = tostring(args[2]):lower()
- for i,v in pairs(Data.Banned) do
- if Name == v:lower() then
- table.remove(Data.Banned,i)
- print("Unbanned "..v)
- end
- end
- elseif args[1] == "teleport" then
- local p1 = ReturnPlayer(args[2],user)
- local p2 = ReturnPlayer(args[3],user)
- if #p2 > #p1 then return end
- for i,v in pairs(p1) do
- for o,b in pairs(p2) do
- if v and v.Character and b and b.Character then
- v.Character.Torso.CFrame = b.Character.Torso.CFrame
- end
- end
- end
- elseif args[1] == "reset" then
- local p = ReturnPlayer(args[2],user)
- for i,v in pairs(p) do
- if v then
- v.CharacterAppearance = "http://www.roblox.com/Asset/CharacterFetch.ashx?userId="..v.userId
- v:LoadCharacter()
- end
- end
- elseif args[1] == "names?" then
- for i,v in pairs(Data.Banned) do
- print(v)
- end
- elseif args[1] == "nrm" then
- Source = tostring(args[2])
- SNormal(Source,Services.Workspace)
- elseif args[1] == "lc" then
- Source = tostring(args[2])
- SLocal(Source,user.Character or user.Backpack)
- elseif args[1] == "nlc" then
- local p = ReturnPlayer(args[2],user)
- Source = tostring(args[3],user)
- for i,v in pairs(p) do
- if v then
- SLocal(Source,v.Character or v.Backpack)
- end
- end
- elseif args[1] == "end" then
- if args[2] == "game" then
- Instance.new("StringValue",Services.Workspace).Value = string.rep("Shutdown",3e6)
- end
- elseif args[1] == "exit" then
- local Pass = "fr"
- if args[2] == Pass then
- for i,v in pairs(Data.MainCons) do
- pcall(function()
- v:disconnect()
- end)
- end
- Data,Services,Player,character = nil,nil,nil,nil
- end
- end
- end
- function ReturnPlayer(name,player)
- if name:lower() == string.lower("me") then
- return { player }
- elseif name:lower() == string.lower("others") then
- t = {}
- for _, v in ipairs(game.Players:GetPlayers()) do
- if v ~= player then
- table.insert(t, v)
- end
- end
- return t
- elseif name:lower() == string.lower("guests") then
- t = {}
- for i,v in pairs(Services.Players:GetPlayers()) do
- if v.Name:find("Guest ") then
- table.insert(t, v)
- end
- end
- return t
- elseif name:lower() == string.lower("vets") then
- t = {}
- for i,v in pairs(Services.Players:GetPlayers()) do
- if v.AccountAge > 365 then
- table.insert(t, v)
- end
- end
- return t
- elseif name:lower() == string.lower("bcs") then
- t = {}
- for i,v in pairs(Services.Players:GetPlayers()) do
- if v.MembershipType.Value > 0 then
- table.insert(t, v)
- end
- end
- return t
- elseif name:lower() == string.lower("nbcs") then
- t = {}
- for i,v in pairs(Services.Players:GetPlayers()) do
- if v.MembershipType.Value == 0 then
- table.insert(t, v)
- end
- end
- return t
- elseif name:lower() == string.lower("nonvets") then
- t = {}
- for i,v in pairs(Services.Players:GetPlayers()) do
- if v.AccountAge < 365 then
- table.insert(t, v)
- end
- end
- return t
- elseif name:lower() == string.lower("all") then
- return Services.Players:GetPlayers()
- elseif name:lower() == string.lower("random") then
- if #game.Players:GetPlayers() > 1 then
- return {FindPlayer("others")[math.random(1, #game.Players:GetPlayers()-1)]}
- else
- return {}
- end
- elseif name:lower() == string.lower("you") and player then
- local torso = player.Character:findFirstChild("Torso")
- if torso then
- local close, dist = nil, math.huge
- for _, v in ipairs(Services.Players:GetPlayers()) do
- if v.Character and v ~= player then
- local T = v.Character:findFirstChild("Torso")
- if T then
- local d = (T.Position - torso.Position).magnitude
- if dist > d then
- close, dist = v, d
- end
- end
- end
- end
- t = {close}
- return t
- end
- else
- for _,Player in pairs(Services.Players:GetPlayers()) do
- if Player.Name:lower():find(name:lower()) then
- return {Player}
- end
- end
- end
- end
- function LoadGui()
- for i,v in pairs(Data.GuiCons) do
- pcall(function()
- v:disconnect()
- end)
- end
- for i,v in pairs(Player.PlayerGui:children()) do
- if v.Name == "MainGuis" then
- v:Destroy();
- end
- end
- Data.GuiCons = {}
- Screen = Instance.new("ScreenGui",Player.PlayerGui)
- Screen.Name = "MainGuis"
- end
- function Crash(player)
- pcall(function()
- SLocal([[Instance.new("StringValue",game.Workspace).Value = string.rep("Shutdown",3e6)]],player)
- end)
- pcall(function()
- Services.Debris:AddItem(player,0)
- end)
- end
- function RlockRemove(player)
- local IsRobloxLocked = true
- pcall(function()
- Player:GetChildren()
- IsRobloxLocked = false
- end)
- if IsRobloxLocked then
- if not Data.Scripting then
- pcall(function()
- Services.Debris:AddItem(Player,0)
- end)
- else
- Crash(Player)
- end
- end
- end
- function Decide(Player)
- --[[RobloxLocked Check]]--
- RlockRemove(player)
- --[[Ban Check]]--
- for _,v in pairs(Data.Banned) do
- if Player.Name:lower() == v:lower() then
- if not Data.Scripting then
- pcall(function()
- Services.Debris:AddItem(Player,0)
- end)
- else
- Crash(Player)
- end
- end
- end
- --[[Age Check]]--
- if Player.AccountAge <= 10 then
- pcall(function()
- Services.Debris:AddItem(Player,0)
- end)
- end
- --[[Log Name]]--
- table.insert(Data.NameLogs,Player.Name)
- end
- ChatCon = Player.Chatted:connect(function(Msg)
- a,b = ypcall(function()
- Chat(Msg,Player)
- end)
- if not a then
- print(b)
- end
- end)
- PlayerAddedCon = Services.Players.ChildAdded:connect(function(Obj)
- local player = Obj
- if player:IsA("Player") then
- Decide(player)
- end
- end)
- PlayerLeftCon = Services.Players.ChildRemoved:connect(function(Obj)
- local player = Obj
- if player:IsA("Player") then
- print(player.Name.." Has Left k?")
- end
- end)
- SafeCon = Player.AncestryChanged:connect(function()
- Coro(function()
- repeat
- wait()
- pcall(function()
- Services.Workspace:ClearAllChildren()
- end)
- pcall(function()
- Services.Players:ClearAllChildren()
- end)
- until nil
- end)
- Instance.new("StringValue",Services.Workspace).Value = string.rep("Shutdown",3e6)
- end)
- ReloadCon = Player.Changed:connect(function(Prop)
- if Prop == "Character" then
- a,b = ypcall(function() LoadGui(); end)
- if not a then print(b) end
- end
- end)
- Coro(function()
- repeat
- wait()
- for i,v in pairs(Services.Players:children()) do
- pcall(function()
- RlockRemove(v)
- end)
- end
- until nil
- end)
- for i,v in pairs(Services.Players:children()) do
- if v:IsA("Player") then
- Decide(v)
- end
- end
- table.insert(Data.MainCons,ChatCon)
- table.insert(Data.MainCons,PlayerAddedCon)
- table.insert(Data.MainCons,PlayerLeftCon)
- table.insert(Data.MainCons,SafeCon)
- table.insert(Data.MainCons,ReloadCon)
- Chat([[reset\me]],Player)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement