Advertisement
ttyyuu12345

Accessible Exterior

Sep 1st, 2016
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.88 KB | None | 0 0
  1. script.Parent = workspace
  2. bet = "/"
  3. flagPrefix = ""
  4. commands = {
  5. {["Name"]="kill",["Args"] = [[player]],["Execute"]= function(msg,speaker,rank)
  6. local args = Core.StringSplit(msg,bet)
  7. if args[1]==nil then
  8. args = {"me"}
  9. end
  10. local pls = FilterPlayers(args[1],speaker)
  11. for i=1,#pls do
  12. if pls[i].Character~=nil then
  13. pls[i].Character:BreakJoints()
  14. end
  15. end
  16. end},
  17. {
  18. ["Name"]="humanoid",
  19. ["Args"]=[["(flagPrefix)p player" "(flagPrefix)WalkSpeed double" "(flagPrefix)MaxHealth double" "(flagPrefix)Health double" "(flagPrefix)Jump" "(flagPrefix)Sit" "(flagPrefix)default"]],
  20. ["Execute"]=function(msg,speaker,rank)
  21. local dsets = {
  22. ["WalkSpeed"]=16,
  23. ["MaxHealth"]=100,
  24. ["Health"]=100,
  25. ["Jump"]=false,
  26. ["Sit"]=false,
  27. }
  28. local sete = {
  29. ["WalkSpeed"]=nil,
  30. ["MaxHealth"]=nil,
  31. ["Health"]=nil,
  32. ["Jump"]=nil,
  33. ["Sit"]=nil,
  34. }
  35. local pl = "me"
  36. local args = Core.StringSplit(msg,bet)
  37. for i=1,#args do
  38. if args[i+1]~=nil then
  39. if args[i]==flagPrefix.."p" then
  40. pl = args[i+1]
  41. end
  42. if args[i]==flagPrefix.."WalkSpeed" then
  43. sete.WalkSpeed = tonum(args[i+1])
  44. end
  45. if args[i]==flagPrefix.."MaxHealth" then
  46. sete.MaxHealth = tonum(args[i+1])
  47. end
  48. if args[i]==flagPrefix.."Health" then
  49. sete.Health = tonum(args[i+1])
  50. end
  51. end
  52. if args[i]==flagPrefix.."Sit" then
  53. sete.Sit = true
  54. end
  55. if args[i]==flagPrefix.."Jump" then
  56. sete.Jump = true
  57. end
  58. if args[i]==flagPrefix.."default" then
  59. sete = dsets
  60. end
  61. end
  62. local pls = FilterPlayers(pl,speaker)
  63. for i=1,#pls do
  64. local char = pls[i].Character
  65. if char~=nil then
  66. local hum = Object.getclass(char:GetChildren(),"Humanoid")[1]
  67. if hum~=nil then
  68. for i,v in pairs(sete) do
  69. if sete[i]~=nil then
  70. hum[i]=sete[i]
  71. end
  72. end
  73. end
  74. end
  75. end
  76. end,
  77. },
  78. {["Name"]="kick",["Args"] = [[player]],["Execute"]= function(msg,speaker,rank)
  79. local args = Core.StringSplit(msg,bet)
  80. if args[1]==nil then
  81. args = {"me"}
  82. end
  83. local pls = FilterPlayers(args[1],speaker)
  84. for i=1,#pls do
  85. pls[i]:Remove()
  86. end
  87. end},
  88. {["Name"]="ff",["Args"] = "player",["Execute"]= function(msg,speaker,rank)
  89. local args = Core.StringSplit(msg,bet)
  90. if args[1]==nil then
  91. args = {"me"}
  92. end
  93. local pls = FilterPlayers(args[1],speaker)
  94. for i=1,#pls do
  95. if pls[i].Character~=nil then
  96. Object.new("ForceField",pls[i].Character)
  97. end
  98. end
  99. end},
  100. {["Name"]="unff",["Args"] = "player",["Execute"]= function(msg,speaker,rank)
  101. local args = Core.StringSplit(msg,bet)
  102. if args[1]==nil then
  103. args = {"me"}
  104. end
  105. local pls = FilterPlayers(args[1],speaker)
  106. for i=1,#pls do
  107. if pls[i].Character~=nil then
  108. Object.getclass(pls[i].Character,"ForceField"):Remove()
  109. end
  110. end
  111. end},
  112. {["Name"]="tp",["Args"] = [["(flagPrefix)p Player to teleport" "(flagPrefix)d Destination player"]],["Execute"]= function(msg,speaker,rank)
  113. local args = Core.StringSplit(msg,bet)
  114. local player = "me"
  115. local destination = "random"
  116. for i=1,#args do
  117. if args[i]==flagPrefix .. "d" then
  118. if args[i+1]~=nil then
  119. destination = args[i+1]
  120. end
  121. end
  122. if args[i]==flagPrefix .. "p" then
  123. if args[i+1]~=nil then
  124. player = args[i+1]
  125. end
  126. end
  127. end
  128. local pls = FilterPlayers(player,speaker)
  129. local des = FilterPlayers(destination,speaker)[1]
  130. for i=1,#pls do
  131. if pls[i].Character~=nil then
  132. local a,tor = ypcall(function() return des.Character.Torso end)
  133. if tor~=nil then
  134. pls[i].Character:MoveTo(tor.Position)
  135. end
  136. end
  137. end
  138. end},
  139. }
  140. function processColor3(str)
  141. local r = 0
  142. local g = 0
  143. local b = 0
  144. local vals = Core.StringSplit(str,",")
  145. if #vals==3 then
  146. r = tonum(vals[1])
  147. g = tonum(vals[2])
  148. b = tonum(vals[3])
  149. end
  150. return Color3.new(r/255,g/255,b/255)
  151. end
  152. playerfilters = {
  153. {["Name"] = "all",["get"] = function(plrlist,speaker)
  154. return plrlist
  155. end},
  156. {["Name"] = "me",["get"] = function(plrlist,speaker)
  157. return {speaker}
  158. end},
  159. {["Name"] = "guests",["get"] = function(plrlist,speaker)
  160. local pllist = {}
  161. for i=1,#plrlist do
  162. if string.lower(string.sub((plrlist[i].Name),1,6))=="guest " then
  163. table.insert(pllist,plrlist[i])
  164. end
  165. end
  166. return pllist
  167. end},
  168. {["Name"] = "random",["get"] = function(plrlist,speaker)
  169. return {plrlist[math.random(1,#plrlist)]}
  170. end},
  171. {["Name"] = "others",["get"] = function(plrlist,speaker)
  172. local pllist = {}
  173. for i=1,#plrlist do
  174. if plrlist[i]~=speaker then
  175. table.insert(pllist,plrlist[i])
  176. end
  177. end
  178. return pllist
  179. end},
  180. }
  181. CleanTable = function(tbl)
  182. local ret = {}
  183. local isBadThing = function(item)
  184. local badthing = {"",nil}
  185. local ret1 = false
  186. for i=1,#badthing do
  187. if item==badthing[i] then
  188. ret1 = true
  189. end
  190. end
  191. return ret1
  192. end
  193. for i=1,#tbl do
  194. if not isBadThing(tbl[i]) then
  195. table.insert(ret,tbl[i])
  196. end
  197. end
  198. return ret
  199. end
  200. StringSplit = function(str,char,ignbound1,ignbound2)
  201. local currentNumber = 1
  202. local quote = false
  203. local quoteNumber = 0
  204. local ret = {}
  205. if (char==ignbound1)or(char==ignbound2) then
  206. print("Please do not set char and ignbound to the same value")
  207. end
  208. for i=1,#str do
  209. local strin = string.sub((str),currentNumber,i-1)
  210. if (ignbound1~=nil)and(ignbound2~=nil) then
  211. if not quote then
  212. if string.sub((str),i,(i-1)+#ignbound1)==ignbound1 then
  213. table.insert(ret,string.sub((str),currentNumber,i-1))
  214. quote = true
  215. quoteNumber = (i-1)+#ignbound1
  216. end
  217. else
  218. if string.sub((str),i+1-#ignbound2,i)==ignbound2 then
  219. table.insert(ret,string.sub((str),quoteNumber+1,i-#ignbound2))
  220. quote = false
  221. currentNumber = i+1
  222. end
  223. end
  224. end
  225. if string.sub((str),i,(i-1)+#char)==char then
  226. if not quote then
  227. table.insert(ret,strin)
  228. currentNumber = i+#char
  229. end
  230. end
  231. end
  232. table.insert(ret,string.sub((str),currentNumber,#str))
  233. return CleanTable(ret)
  234. end
  235. ReplaceWith = function(str,old,new)
  236. local ret = nil
  237. if str~=nil then
  238. ret = ""
  239. str = "\1" .. str .. "\1"
  240. local objs = StringSplit(str,old)
  241. for i=1,#objs do
  242. ret = ret .. objs[i]
  243. if i~=#objs then
  244. ret = ret .. new
  245. end
  246. end
  247. ret = string.sub(ret,2,#ret-1)
  248. end
  249. return ret
  250. end
  251. Object = {
  252. ["Ver"] = 1.43,
  253. ["inh"] = function(e)
  254. function e:Remove()
  255. for i=1,#e do
  256. if e[i]~=script then
  257. ypcall(function() e[i]:Remove() end)
  258. end
  259. end
  260. e=nil
  261. end
  262. function e:Destroy()
  263. for i=1,#e do
  264. Object.remove(e[i])
  265. end
  266. e=nil
  267. end
  268. function e:ClearAllChildren()
  269. for i=1,#e do
  270. Object.clear(e[i])
  271. end
  272. end
  273. function e:SetName(name)
  274. for i=1,#e do
  275. ypcall(function() e[i].Name = name end)
  276. end
  277. end
  278. function e:Clone(par)
  279. local tab = Object.inh({})
  280. for i=1,#e do
  281. ypcall(function() table.insert(tab,Object.clone(e[i],par)) end)
  282. end
  283. return tab
  284. end
  285. return e
  286. end,
  287. ["new"] = function(class,par,name)
  288. local obj = nil
  289. if par==nil then
  290. par = game.Workspace
  291. end
  292. if (name~=nil)and(tostring(name)~=nil) then
  293. name = tostring(name)
  294. else
  295. name = tostring(class)
  296. end
  297. if tostring(class)~=nil then
  298. class = tostring(class)
  299. else
  300. class = "Sound"
  301. end
  302. ypcall(function()
  303. obj = Instance.new(class,par)
  304. obj.Name = name
  305. end)
  306. return obj
  307. end,
  308. ["gs"] = function(service)
  309. local ret = nil
  310. if game:GetService(service)~=nil then
  311. ret = game:GetService(service)
  312. end
  313. return ret
  314. end,
  315. ["master"] = game,
  316. ["remove"] = function(obj)
  317. if (obj~=script) then
  318. ypcall(function() obj:Destroy() end)
  319. end
  320. end,
  321. ["clone"] = function(obj,par)
  322. local r = nil
  323. ypcall(function() r=obj:Clone() r.Parent = par end)
  324. return r
  325. end,
  326. ["clear"] = function(obj)
  327. if (obj~=nil) and (type(obj)=="userdata") then
  328. local chil = obj:GetChildren()
  329. for i=1,#chil do
  330. ypcall(function() chil[i]:Destroy() end)
  331. end
  332. end
  333. end,
  334. ["getclass"] = function(obj,...)
  335. local e = Object.inh({})
  336. if obj~=nil then
  337. local b = {}
  338. if type(obj)=="userdata" then
  339. b = obj:GetChildren()
  340. elseif type(obj)=="table" then
  341. b = obj
  342. end
  343. local classes = {...}
  344. for i=1,#b do
  345. for t=1,#classes do
  346. if b[i]:IsA(classes[t]) then
  347. table.insert(e,b[i])
  348. end
  349. end
  350. end
  351. end
  352. return e
  353. end,
  354. ["contbl"] = function(...)
  355. local tbl = {}
  356. local tbls = {...}
  357. for i,v in pairs(tbls) do
  358. for t=1,#v do
  359. table.insert(tbl,v[t])
  360. end
  361. end
  362. return tbl
  363. end,
  364. ["getproperty"] = function(obj,prop)
  365. local e = Object.inh({})
  366. local b = {}
  367. if obj~=nil then
  368. if type(obj)=="userdata" then
  369. b = obj:GetChildren()
  370. elseif type(obj)=="table" then
  371. b=obj
  372. end
  373. for i,v in pairs(b) do
  374. local r = nil
  375. ypcall(function() r=v[prop] end)
  376. if r~=nil then
  377. table.insert(e,v)
  378. end
  379. end
  380. end
  381. return e
  382. end,
  383. ["tree"] = function(obj)
  384. local tab = {}
  385. local b = obj:GetChildren()
  386. for i=1,#b do
  387. table.insert(tab,b[i])
  388. local rd = Object.tree(b[i])
  389. for t=1,#rd do
  390. table.insert(tab,rd[t])
  391. end
  392. end
  393. return tab
  394. end,
  395. }
  396. Core = {
  397. ["Ver"] = 4.1,
  398. ["Clear"] = function()
  399. Object.inh(Object.tree(workspace)):Destroy()
  400. local pls = Object.getclass(Object.gs("Players"),"Player")
  401. if script.className~="LocalScript" then
  402. for i=1,#pls do
  403. pls[i]:LoadCharacter()
  404. end
  405. end
  406. Object.clear(Object.gs("StarterPack"))
  407. Object.clear(Object.gs("StarterGui"))
  408. Object.clear(Object.gs("Teams"))
  409. Object.clear(Object.gs("Lighting"))
  410. Object.clear(Object.gs("ReplicatedFirst"))
  411. Object.clear(Object.gs("ReplicatedStorage"))
  412. Object.clear(Object.gs("ServerScriptService"))
  413. Object.clear(Object.gs("ServerStorage"))
  414. local b = Object.new("Part",game.Workspace,"BasePlate")
  415. b.FormFactor = "Custom"
  416. b.Size = Vector3.new( 512, 0.4, 512)
  417. b.Position = Vector3.new ( 0, 0, 0)
  418. b.BrickColor = BrickColor.new("Earth green")
  419. b.Material = Enum.Material.Grass
  420. b.Locked = true
  421. b.Anchored = true
  422. end,
  423. ["SplitString"] = function(str,char)
  424. print("This method is deprecated, it may be removed")
  425. local ms1 = ""
  426. local ms2 = ""
  427. for i=1,#str do
  428. if string.sub((str),i,i)==char then
  429. ms1 = string.sub((str),1,(i-1))
  430. ms2 = string.sub((str),(i+1),#str)
  431. break
  432. end
  433. end
  434. return ms1,ms2
  435. end,
  436. ["StringSplit"] = function(str,char)
  437. local tbl = StringSplit(str,char,[["]],[["]])
  438. local ret = {}
  439. for i=1,#tbl do
  440. table.insert(ret,ReplaceWith(ReplaceWith(tbl[i],"\\n","\n"),"\\5","\5"))
  441. end
  442. return ret
  443. end,
  444. ["window"] = function(par,pos,size,title)
  445. local root = nil
  446. if par:IsA("Player") then
  447. par = Object.new("ScreenGui",Object.getclass(par,"PlayerGui")[1])
  448. root = par
  449. elseif (par:IsA("PlayerGui"))or(par:IsA("StarterGui")) then
  450. par = Object.new("ScreenGui",par)
  451. root = par
  452. end
  453. local frame = Object.new("Frame",par)
  454. if root==nil then
  455. root = frame
  456. end
  457. frame.Size = size
  458. frame.Position = pos
  459. frame.Active = true
  460. frame.Style="DropShadow"
  461. frame.Draggable = true
  462. frame.BackgroundColor3 = Color3.new(0,0,0)
  463. frame.BackgroundTransparency = 0.5
  464. frame.BorderSizePixel = 0
  465. local tl = Object.new("TextLabel",frame)
  466. tl.BackgroundTransparency = 1
  467. tl.TextColor = BrickColor.new("White")
  468. tl.Size = UDim2.new(1,0,0,20)
  469. tl.Text = title
  470. tl.FontSize = "Size18"
  471. tl.TextXAlignment = "Left"
  472. local exit = Object.new("TextButton",tl)
  473. exit.Size = UDim2.new(0,20,1,0)
  474. exit.Position = UDim2.new( 1, -25, 0, 0)
  475. exit.BorderSizePixel = 0
  476. exit.BackgroundColor = BrickColor.new("Bright red")
  477. exit.TextColor3 = Color3.new(1,0,0)
  478. exit.BackgroundTransparency = 1
  479. exit.FontSize = Enum.FontSize.Size18
  480. exit.Text = "X"
  481. exit.MouseButton1Click:connect(function()
  482. Object.remove(root)
  483. end)
  484. local elements = Object.new("Frame",frame)
  485. elements.Position = UDim2.new(0,2,0,22)
  486. elements.BackgroundTransparency = 0
  487. elements.BorderSizePixel = 0
  488. elements.Size = UDim2.new(1,-4,1,-24)
  489. elements.BackgroundColor = BrickColor.new("White")
  490. return root,elements
  491. end,
  492. ["CMessage"] = function(par,title,text)
  493. local root,elements = Core.window(par,UDim2.new(0.5,-200,0.5,-75),UDim2.new(0,400,0,200),title)
  494. local tl = Object.new("TextLabel",elements)
  495. tl.Position = UDim2.new(0,0,0,0)
  496. tl.Size = UDim2.new(1,0,0.65,0)
  497. tl.BorderSizePixel = 0
  498. tl.TextColor = BrickColor.new("Black")
  499. tl.Text = text
  500. tl.BackgroundTransparency = 1
  501. tl.FontSize = "Size18"
  502. tl.TextWrapped = true
  503. tl.TextYAlignment = "Top"
  504. tl.TextXAlignment = "Left"
  505. local ok = Object.new("TextButton",elements)
  506. ok.Size = UDim2.new( 0.3, 0, 0.3, 0)
  507. ok.Position = UDim2.new( 0.7, 0, 0.65, 0)
  508. ok.FontSize = "Size24"
  509. ok.BackgroundColor = BrickColor.new("Black")
  510. ok.BorderSizePixel = 0
  511. ok.Style="RobloxRoundButton"
  512. ok.TextColor = BrickColor.new("White")
  513. ok.Text = "OK"
  514. ok.MouseButton1Click:connect(function()
  515. Object.remove(root)
  516. end)
  517. end,
  518. ["GetMenu"] = function(par,title,tbl)
  519. local csiz = 1
  520. local bsizy = 0.05
  521. local bsizxoffs = 0
  522. if #tbl>=20 then
  523. csiz = #tbl/20
  524. bsizy = 1/#tbl
  525. bsizxoffs = -12
  526. end
  527. local gui,win = Core.window(par,UDim2.new(0.5,-256,0.5,-192),UDim2.new(0,512,0,384),title)
  528. win.Parent.Draggable = false
  529. local frame = Object.new("ScrollingFrame",win)
  530. frame.Size = UDim2.new(1,0,1,0)
  531. frame.CanvasSize = UDim2.new(0,0,csiz,0)
  532. frame.BorderSizePixel = 0
  533. frame.BackgroundTransparency = 1
  534. for i,v in pairs(tbl) do
  535. local tb = Instance.new("TextButton",frame)
  536. tb.Size = UDim2.new(1,bsizxoffs,bsizy,0)
  537. tb.Position = UDim2.new(0,0,(i-1)*bsizy,0)
  538. tb.BackgroundTransparency = 1
  539. tb.BackgroundColor = BrickColor.new("Black")
  540. tb.BorderSizePixel = 0
  541. tb.TextColor = BrickColor.new("Black")
  542. tb.Text = v.Name
  543. tb.FontSize = Enum.FontSize.Size11
  544. tb.TextXAlignment = Enum.TextXAlignment.Left
  545. if v.Execute~=nil then
  546. tb.MouseButton1Click:connect(function()
  547. if par:IsA("Player") then
  548. v.Execute(par)
  549. else
  550. v.Execute()
  551. end
  552. Object.remove(gui)
  553. end)
  554. end
  555. if v.RightClick~=nil then
  556. tb.MouseButton2Click:connect(function()
  557. Object.remove(gui)
  558. if par:IsA("Player") then
  559. v.RightClick(par)
  560. else
  561. v.RightClick()
  562. end
  563. end)
  564. end
  565. end
  566. end,
  567. ["GetList"] = function(par,title,tbl)
  568. local men = {}
  569. for i=1,#tbl do
  570. local obj = {}
  571. obj.Name = tbl[i]
  572. table.insert(men,obj)
  573. end
  574. Core.GetMenu(par,title,men)
  575. end,
  576. }
  577. function tonum(str)
  578. local num = 0
  579. if str=="mh" then
  580. num = math.huge
  581. elseif tonumber(str)~=nil then
  582. num = tonumber(str)
  583. end
  584. return num
  585. end
  586. function FilterPlayers(str,speaker)
  587. local play = {}
  588. local pls = Object.getclass(Object.gs("Players"),"Player")
  589. local args = Core.StringSplit(str,",")
  590. if #args>=2 then
  591. for i=1,#args do
  592. local pldf = FilterPlayers(args[i],speaker)
  593. for t=1,#pldf do
  594. table.insert(play,pldf[t])
  595. end
  596. end
  597. end
  598. for i,v in pairs(playerfilters) do
  599. if string.lower(str)==string.lower(v.Name) then
  600. play = v.get(pls,speaker)
  601. end
  602. end
  603. if #play==0 then
  604. for i=1,#pls do
  605. if (string.find(string.lower(pls[i].Name), string.lower(str))==1) then
  606. table.insert(play,pls[i])
  607. end
  608. end
  609. end
  610. return play
  611. end
  612. function Chat(msg,speaker)
  613. if string.sub((msg),1,3)=="/e " then
  614. msg = string.sub((msg),4)
  615. end
  616. for i,v in pairs(commands) do
  617. local fac = ReplaceWith(v.Name,"(bet)",bet)
  618. if fac~=nil then
  619. local msgnum = #fac
  620. if (string.sub((msg),1,msgnum)==fac)and(v.Execute~=nil) then
  621. local work,err = ypcall(function() v.Execute(string.sub((msg),msgnum+1),speaker) end)
  622. if not work then print(err) end
  623. end
  624. end
  625. end
  626. end
  627. function connectChat(pl)
  628. pl.Chatted:connect(function(msg)
  629. Chat(msg,pl)
  630. end)
  631. end
  632. connectChat(game.Players.LocalPlayer)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement