Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- script.Parent = workspace
- bet = "/"
- flagPrefix = ""
- commands = {
- {["Name"]="kill",["Args"] = [[player]],["Execute"]= function(msg,speaker,rank)
- local args = Core.StringSplit(msg,bet)
- if args[1]==nil then
- args = {"me"}
- end
- local pls = FilterPlayers(args[1],speaker)
- for i=1,#pls do
- if pls[i].Character~=nil then
- pls[i].Character:BreakJoints()
- end
- end
- end},
- {
- ["Name"]="humanoid",
- ["Args"]=[["(flagPrefix)p player" "(flagPrefix)WalkSpeed double" "(flagPrefix)MaxHealth double" "(flagPrefix)Health double" "(flagPrefix)Jump" "(flagPrefix)Sit" "(flagPrefix)default"]],
- ["Execute"]=function(msg,speaker,rank)
- local dsets = {
- ["WalkSpeed"]=16,
- ["MaxHealth"]=100,
- ["Health"]=100,
- ["Jump"]=false,
- ["Sit"]=false,
- }
- local sete = {
- ["WalkSpeed"]=nil,
- ["MaxHealth"]=nil,
- ["Health"]=nil,
- ["Jump"]=nil,
- ["Sit"]=nil,
- }
- local pl = "me"
- local args = Core.StringSplit(msg,bet)
- for i=1,#args do
- if args[i+1]~=nil then
- if args[i]==flagPrefix.."p" then
- pl = args[i+1]
- end
- if args[i]==flagPrefix.."WalkSpeed" then
- sete.WalkSpeed = tonum(args[i+1])
- end
- if args[i]==flagPrefix.."MaxHealth" then
- sete.MaxHealth = tonum(args[i+1])
- end
- if args[i]==flagPrefix.."Health" then
- sete.Health = tonum(args[i+1])
- end
- end
- if args[i]==flagPrefix.."Sit" then
- sete.Sit = true
- end
- if args[i]==flagPrefix.."Jump" then
- sete.Jump = true
- end
- if args[i]==flagPrefix.."default" then
- sete = dsets
- end
- end
- local pls = FilterPlayers(pl,speaker)
- for i=1,#pls do
- local char = pls[i].Character
- if char~=nil then
- local hum = Object.getclass(char:GetChildren(),"Humanoid")[1]
- if hum~=nil then
- for i,v in pairs(sete) do
- if sete[i]~=nil then
- hum[i]=sete[i]
- end
- end
- end
- end
- end
- end,
- },
- {["Name"]="kick",["Args"] = [[player]],["Execute"]= function(msg,speaker,rank)
- local args = Core.StringSplit(msg,bet)
- if args[1]==nil then
- args = {"me"}
- end
- local pls = FilterPlayers(args[1],speaker)
- for i=1,#pls do
- pls[i]:Remove()
- end
- end},
- {["Name"]="ff",["Args"] = "player",["Execute"]= function(msg,speaker,rank)
- local args = Core.StringSplit(msg,bet)
- if args[1]==nil then
- args = {"me"}
- end
- local pls = FilterPlayers(args[1],speaker)
- for i=1,#pls do
- if pls[i].Character~=nil then
- Object.new("ForceField",pls[i].Character)
- end
- end
- end},
- {["Name"]="unff",["Args"] = "player",["Execute"]= function(msg,speaker,rank)
- local args = Core.StringSplit(msg,bet)
- if args[1]==nil then
- args = {"me"}
- end
- local pls = FilterPlayers(args[1],speaker)
- for i=1,#pls do
- if pls[i].Character~=nil then
- Object.getclass(pls[i].Character,"ForceField"):Remove()
- end
- end
- end},
- {["Name"]="tp",["Args"] = [["(flagPrefix)p Player to teleport" "(flagPrefix)d Destination player"]],["Execute"]= function(msg,speaker,rank)
- local args = Core.StringSplit(msg,bet)
- local player = "me"
- local destination = "random"
- for i=1,#args do
- if args[i]==flagPrefix .. "d" then
- if args[i+1]~=nil then
- destination = args[i+1]
- end
- end
- if args[i]==flagPrefix .. "p" then
- if args[i+1]~=nil then
- player = args[i+1]
- end
- end
- end
- local pls = FilterPlayers(player,speaker)
- local des = FilterPlayers(destination,speaker)[1]
- for i=1,#pls do
- if pls[i].Character~=nil then
- local a,tor = ypcall(function() return des.Character.Torso end)
- if tor~=nil then
- pls[i].Character:MoveTo(tor.Position)
- end
- end
- end
- end},
- }
- function processColor3(str)
- local r = 0
- local g = 0
- local b = 0
- local vals = Core.StringSplit(str,",")
- if #vals==3 then
- r = tonum(vals[1])
- g = tonum(vals[2])
- b = tonum(vals[3])
- end
- return Color3.new(r/255,g/255,b/255)
- end
- playerfilters = {
- {["Name"] = "all",["get"] = function(plrlist,speaker)
- return plrlist
- end},
- {["Name"] = "me",["get"] = function(plrlist,speaker)
- return {speaker}
- end},
- {["Name"] = "guests",["get"] = function(plrlist,speaker)
- local pllist = {}
- for i=1,#plrlist do
- if string.lower(string.sub((plrlist[i].Name),1,6))=="guest " then
- table.insert(pllist,plrlist[i])
- end
- end
- return pllist
- end},
- {["Name"] = "random",["get"] = function(plrlist,speaker)
- return {plrlist[math.random(1,#plrlist)]}
- end},
- {["Name"] = "others",["get"] = function(plrlist,speaker)
- local pllist = {}
- for i=1,#plrlist do
- if plrlist[i]~=speaker then
- table.insert(pllist,plrlist[i])
- end
- end
- return pllist
- end},
- }
- CleanTable = function(tbl)
- local ret = {}
- local isBadThing = function(item)
- local badthing = {"",nil}
- local ret1 = false
- for i=1,#badthing do
- if item==badthing[i] then
- ret1 = true
- end
- end
- return ret1
- end
- for i=1,#tbl do
- if not isBadThing(tbl[i]) then
- table.insert(ret,tbl[i])
- end
- end
- return ret
- end
- StringSplit = function(str,char,ignbound1,ignbound2)
- local currentNumber = 1
- local quote = false
- local quoteNumber = 0
- local ret = {}
- if (char==ignbound1)or(char==ignbound2) then
- print("Please do not set char and ignbound to the same value")
- end
- for i=1,#str do
- local strin = string.sub((str),currentNumber,i-1)
- if (ignbound1~=nil)and(ignbound2~=nil) then
- if not quote then
- if string.sub((str),i,(i-1)+#ignbound1)==ignbound1 then
- table.insert(ret,string.sub((str),currentNumber,i-1))
- quote = true
- quoteNumber = (i-1)+#ignbound1
- end
- else
- if string.sub((str),i+1-#ignbound2,i)==ignbound2 then
- table.insert(ret,string.sub((str),quoteNumber+1,i-#ignbound2))
- quote = false
- currentNumber = i+1
- end
- end
- end
- if string.sub((str),i,(i-1)+#char)==char then
- if not quote then
- table.insert(ret,strin)
- currentNumber = i+#char
- end
- end
- end
- table.insert(ret,string.sub((str),currentNumber,#str))
- return CleanTable(ret)
- end
- ReplaceWith = function(str,old,new)
- local ret = nil
- if str~=nil then
- ret = ""
- str = "\1" .. str .. "\1"
- local objs = StringSplit(str,old)
- for i=1,#objs do
- ret = ret .. objs[i]
- if i~=#objs then
- ret = ret .. new
- end
- end
- ret = string.sub(ret,2,#ret-1)
- end
- return ret
- end
- Object = {
- ["Ver"] = 1.43,
- ["inh"] = function(e)
- function e:Remove()
- for i=1,#e do
- if e[i]~=script then
- ypcall(function() e[i]:Remove() end)
- end
- end
- e=nil
- end
- function e:Destroy()
- for i=1,#e do
- Object.remove(e[i])
- end
- e=nil
- end
- function e:ClearAllChildren()
- for i=1,#e do
- Object.clear(e[i])
- end
- end
- function e:SetName(name)
- for i=1,#e do
- ypcall(function() e[i].Name = name end)
- end
- end
- function e:Clone(par)
- local tab = Object.inh({})
- for i=1,#e do
- ypcall(function() table.insert(tab,Object.clone(e[i],par)) end)
- end
- return tab
- end
- return e
- end,
- ["new"] = function(class,par,name)
- local obj = nil
- if par==nil then
- par = game.Workspace
- end
- if (name~=nil)and(tostring(name)~=nil) then
- name = tostring(name)
- else
- name = tostring(class)
- end
- if tostring(class)~=nil then
- class = tostring(class)
- else
- class = "Sound"
- end
- ypcall(function()
- obj = Instance.new(class,par)
- obj.Name = name
- end)
- return obj
- end,
- ["gs"] = function(service)
- local ret = nil
- if game:GetService(service)~=nil then
- ret = game:GetService(service)
- end
- return ret
- end,
- ["master"] = game,
- ["remove"] = function(obj)
- if (obj~=script) then
- ypcall(function() obj:Destroy() end)
- end
- end,
- ["clone"] = function(obj,par)
- local r = nil
- ypcall(function() r=obj:Clone() r.Parent = par end)
- return r
- end,
- ["clear"] = function(obj)
- if (obj~=nil) and (type(obj)=="userdata") then
- local chil = obj:GetChildren()
- for i=1,#chil do
- ypcall(function() chil[i]:Destroy() end)
- end
- end
- end,
- ["getclass"] = function(obj,...)
- local e = Object.inh({})
- if obj~=nil then
- local b = {}
- if type(obj)=="userdata" then
- b = obj:GetChildren()
- elseif type(obj)=="table" then
- b = obj
- end
- local classes = {...}
- for i=1,#b do
- for t=1,#classes do
- if b[i]:IsA(classes[t]) then
- table.insert(e,b[i])
- end
- end
- end
- end
- return e
- end,
- ["contbl"] = function(...)
- local tbl = {}
- local tbls = {...}
- for i,v in pairs(tbls) do
- for t=1,#v do
- table.insert(tbl,v[t])
- end
- end
- return tbl
- end,
- ["getproperty"] = function(obj,prop)
- local e = Object.inh({})
- local b = {}
- if obj~=nil then
- if type(obj)=="userdata" then
- b = obj:GetChildren()
- elseif type(obj)=="table" then
- b=obj
- end
- for i,v in pairs(b) do
- local r = nil
- ypcall(function() r=v[prop] end)
- if r~=nil then
- table.insert(e,v)
- end
- end
- end
- return e
- end,
- ["tree"] = function(obj)
- local tab = {}
- local b = obj:GetChildren()
- for i=1,#b do
- table.insert(tab,b[i])
- local rd = Object.tree(b[i])
- for t=1,#rd do
- table.insert(tab,rd[t])
- end
- end
- return tab
- end,
- }
- Core = {
- ["Ver"] = 4.1,
- ["Clear"] = function()
- Object.inh(Object.tree(workspace)):Destroy()
- local pls = Object.getclass(Object.gs("Players"),"Player")
- if script.className~="LocalScript" then
- for i=1,#pls do
- pls[i]:LoadCharacter()
- end
- end
- Object.clear(Object.gs("StarterPack"))
- Object.clear(Object.gs("StarterGui"))
- Object.clear(Object.gs("Teams"))
- Object.clear(Object.gs("Lighting"))
- Object.clear(Object.gs("ReplicatedFirst"))
- Object.clear(Object.gs("ReplicatedStorage"))
- Object.clear(Object.gs("ServerScriptService"))
- Object.clear(Object.gs("ServerStorage"))
- local b = Object.new("Part",game.Workspace,"BasePlate")
- b.FormFactor = "Custom"
- b.Size = Vector3.new( 512, 0.4, 512)
- b.Position = Vector3.new ( 0, 0, 0)
- b.BrickColor = BrickColor.new("Earth green")
- b.Material = Enum.Material.Grass
- b.Locked = true
- b.Anchored = true
- end,
- ["SplitString"] = function(str,char)
- print("This method is deprecated, it may be removed")
- local ms1 = ""
- local ms2 = ""
- for i=1,#str do
- if string.sub((str),i,i)==char then
- ms1 = string.sub((str),1,(i-1))
- ms2 = string.sub((str),(i+1),#str)
- break
- end
- end
- return ms1,ms2
- end,
- ["StringSplit"] = function(str,char)
- local tbl = StringSplit(str,char,[["]],[["]])
- local ret = {}
- for i=1,#tbl do
- table.insert(ret,ReplaceWith(ReplaceWith(tbl[i],"\\n","\n"),"\\5","\5"))
- end
- return ret
- end,
- ["window"] = function(par,pos,size,title)
- local root = nil
- if par:IsA("Player") then
- par = Object.new("ScreenGui",Object.getclass(par,"PlayerGui")[1])
- root = par
- elseif (par:IsA("PlayerGui"))or(par:IsA("StarterGui")) then
- par = Object.new("ScreenGui",par)
- root = par
- end
- local frame = Object.new("Frame",par)
- if root==nil then
- root = frame
- end
- frame.Size = size
- frame.Position = pos
- frame.Active = true
- frame.Style="DropShadow"
- frame.Draggable = true
- frame.BackgroundColor3 = Color3.new(0,0,0)
- frame.BackgroundTransparency = 0.5
- frame.BorderSizePixel = 0
- local tl = Object.new("TextLabel",frame)
- tl.BackgroundTransparency = 1
- tl.TextColor = BrickColor.new("White")
- tl.Size = UDim2.new(1,0,0,20)
- tl.Text = title
- tl.FontSize = "Size18"
- tl.TextXAlignment = "Left"
- local exit = Object.new("TextButton",tl)
- exit.Size = UDim2.new(0,20,1,0)
- exit.Position = UDim2.new( 1, -25, 0, 0)
- exit.BorderSizePixel = 0
- exit.BackgroundColor = BrickColor.new("Bright red")
- exit.TextColor3 = Color3.new(1,0,0)
- exit.BackgroundTransparency = 1
- exit.FontSize = Enum.FontSize.Size18
- exit.Text = "X"
- exit.MouseButton1Click:connect(function()
- Object.remove(root)
- end)
- local elements = Object.new("Frame",frame)
- elements.Position = UDim2.new(0,2,0,22)
- elements.BackgroundTransparency = 0
- elements.BorderSizePixel = 0
- elements.Size = UDim2.new(1,-4,1,-24)
- elements.BackgroundColor = BrickColor.new("White")
- return root,elements
- end,
- ["CMessage"] = function(par,title,text)
- local root,elements = Core.window(par,UDim2.new(0.5,-200,0.5,-75),UDim2.new(0,400,0,200),title)
- local tl = Object.new("TextLabel",elements)
- tl.Position = UDim2.new(0,0,0,0)
- tl.Size = UDim2.new(1,0,0.65,0)
- tl.BorderSizePixel = 0
- tl.TextColor = BrickColor.new("Black")
- tl.Text = text
- tl.BackgroundTransparency = 1
- tl.FontSize = "Size18"
- tl.TextWrapped = true
- tl.TextYAlignment = "Top"
- tl.TextXAlignment = "Left"
- local ok = Object.new("TextButton",elements)
- ok.Size = UDim2.new( 0.3, 0, 0.3, 0)
- ok.Position = UDim2.new( 0.7, 0, 0.65, 0)
- ok.FontSize = "Size24"
- ok.BackgroundColor = BrickColor.new("Black")
- ok.BorderSizePixel = 0
- ok.Style="RobloxRoundButton"
- ok.TextColor = BrickColor.new("White")
- ok.Text = "OK"
- ok.MouseButton1Click:connect(function()
- Object.remove(root)
- end)
- end,
- ["GetMenu"] = function(par,title,tbl)
- local csiz = 1
- local bsizy = 0.05
- local bsizxoffs = 0
- if #tbl>=20 then
- csiz = #tbl/20
- bsizy = 1/#tbl
- bsizxoffs = -12
- end
- local gui,win = Core.window(par,UDim2.new(0.5,-256,0.5,-192),UDim2.new(0,512,0,384),title)
- win.Parent.Draggable = false
- local frame = Object.new("ScrollingFrame",win)
- frame.Size = UDim2.new(1,0,1,0)
- frame.CanvasSize = UDim2.new(0,0,csiz,0)
- frame.BorderSizePixel = 0
- frame.BackgroundTransparency = 1
- for i,v in pairs(tbl) do
- local tb = Instance.new("TextButton",frame)
- tb.Size = UDim2.new(1,bsizxoffs,bsizy,0)
- tb.Position = UDim2.new(0,0,(i-1)*bsizy,0)
- tb.BackgroundTransparency = 1
- tb.BackgroundColor = BrickColor.new("Black")
- tb.BorderSizePixel = 0
- tb.TextColor = BrickColor.new("Black")
- tb.Text = v.Name
- tb.FontSize = Enum.FontSize.Size11
- tb.TextXAlignment = Enum.TextXAlignment.Left
- if v.Execute~=nil then
- tb.MouseButton1Click:connect(function()
- if par:IsA("Player") then
- v.Execute(par)
- else
- v.Execute()
- end
- Object.remove(gui)
- end)
- end
- if v.RightClick~=nil then
- tb.MouseButton2Click:connect(function()
- Object.remove(gui)
- if par:IsA("Player") then
- v.RightClick(par)
- else
- v.RightClick()
- end
- end)
- end
- end
- end,
- ["GetList"] = function(par,title,tbl)
- local men = {}
- for i=1,#tbl do
- local obj = {}
- obj.Name = tbl[i]
- table.insert(men,obj)
- end
- Core.GetMenu(par,title,men)
- end,
- }
- function tonum(str)
- local num = 0
- if str=="mh" then
- num = math.huge
- elseif tonumber(str)~=nil then
- num = tonumber(str)
- end
- return num
- end
- function FilterPlayers(str,speaker)
- local play = {}
- local pls = Object.getclass(Object.gs("Players"),"Player")
- local args = Core.StringSplit(str,",")
- if #args>=2 then
- for i=1,#args do
- local pldf = FilterPlayers(args[i],speaker)
- for t=1,#pldf do
- table.insert(play,pldf[t])
- end
- end
- end
- for i,v in pairs(playerfilters) do
- if string.lower(str)==string.lower(v.Name) then
- play = v.get(pls,speaker)
- end
- end
- if #play==0 then
- for i=1,#pls do
- if (string.find(string.lower(pls[i].Name), string.lower(str))==1) then
- table.insert(play,pls[i])
- end
- end
- end
- return play
- end
- function Chat(msg,speaker)
- if string.sub((msg),1,3)=="/e " then
- msg = string.sub((msg),4)
- end
- for i,v in pairs(commands) do
- local fac = ReplaceWith(v.Name,"(bet)",bet)
- if fac~=nil then
- local msgnum = #fac
- if (string.sub((msg),1,msgnum)==fac)and(v.Execute~=nil) then
- local work,err = ypcall(function() v.Execute(string.sub((msg),msgnum+1),speaker) end)
- if not work then print(err) end
- end
- end
- end
- end
- function connectChat(pl)
- pl.Chatted:connect(function(msg)
- Chat(msg,pl)
- end)
- end
- connectChat(game.Players.LocalPlayer)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement