Advertisement
jai1515hb

Dots

Aug 4th, 2015
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.84 KB | None | 0 0
  1. local Name = "jairyanofficial" -- Your name here.
  2.  
  3. local Prefix = "!" -- What comes before commands.
  4. local Seperator = " " -- What seperates arguments in commands.
  5.  
  6. local Admins = {["jairyanofficial"] = 4} -- Who else can have admin (Dont add your own name, you will be auto added.)
  7. --^Ranks between 1-4, with more commands at each rank.
  8. local Banned = {"Enemy"} -- Who cannot play the game. Set to 1.
  9.  
  10. --< NOTICE >----< NOTICE >----< NOTICE >----< NOTICE >--
  11.  
  12. --Unless you know what your doing,leave the rest alone.
  13.  
  14. --< NOTICE >----< NOTICE >----< NOTICE >----< NOTICE >--
  15.  
  16. local Players = game:GetService("Players")
  17.  
  18. if Players:FindFirstChild(Name) ~= nil then
  19. Player = Players:FindFirstChild(Name)
  20. else
  21. Player = Players:WaitForChild(Name)
  22. end
  23.  
  24. local Character = Player.Character or Player.CharacterAdded:wait()
  25.  
  26. local TabletsModel = Instance.new("Model",workspace)
  27. TabletsModel.Name = "Tablets"
  28.  
  29. local function MakeTablet(Text,Color,DetectorFunction)
  30. if not TabletsModel then return end
  31. local Tablet = Instance.new("Part",TabletsModel)
  32. Tablet.Material = "Neon"
  33. Tablet.Shape = "Block"
  34. Tablet.Name = "Tablet"
  35. Tablet.FormFactor = Enum.FormFactor.Symmetric
  36. Tablet.Size = Vector3.new(2,2,2)
  37. Tablet.CFrame = Character.Torso.CFrame*CFrame.new(0,0,-2*#TabletsModel:GetChildren())
  38. Tablet.CanCollide = false
  39. Tablet.Locked = true
  40. Tablet.BottomSurface = Enum.SurfaceType.Smooth
  41. Tablet.TopSurface = Enum.SurfaceType.Smooth
  42. local TabletSelect = Instance.new("SelectionBox",Tablet)
  43. TabletSelect.Adornee = Tablet
  44. local Detector = Instance.new("ClickDetector",Tablet)
  45. Detector.Name = "Detector"
  46. Detector.MaxActivationDistance = math.huge
  47. local Position = Instance.new("BodyPosition",Tablet)
  48. Position.Name = "TabletPos"
  49. Position.position = Tablet.CFrame.p
  50. Position.maxForce = Vector3.new(9e9,9e9,9e9)
  51. local Light = Instance.new("PointLight",Tablet)
  52. Light.Name = "TabletLight"
  53. Light.Range = 15
  54. Light.Brightness = math.huge
  55. local TabletGui = Instance.new("BillboardGui",Tablet)
  56. TabletGui.Name = "TabletGui"
  57. TabletGui.Active = true
  58. TabletGui.Size = UDim2.new(0,1,0,1)
  59. TabletGui.StudsOffset = Vector3.new(0,2.5,0)
  60. local TabletLabel = Instance.new("TextLabel",TabletGui)
  61. TabletLabel.BackgroundColor3 = Color3.new(0,0,0)
  62. TabletLabel.BackgroundTransparency = 1
  63. TabletLabel.BorderColor3 = Color3.new(0,0,0)
  64. TabletLabel.BorderSizePixel = 0
  65. TabletLabel.Name = "TabletLabel"
  66. TabletLabel.Size = UDim2.new(0,1,0,1)
  67. TabletLabel.Text = Text
  68. TabletLabel.TextColor3 = Color3.new(0,0,0)
  69. TabletLabel.TextStrokeColor3 = Color3.new(1,1,1)
  70. TabletLabel.TextStrokeTransparency = 0
  71. TabletLabel.Font = Enum.Font.SourceSansBold
  72. TabletLabel.FontSize = Enum.FontSize.Size18
  73. if DetectorFunction == nil then DetectorFunction = function() repeat Tablet.Transparency = Tablet.Transparency + .1 wait(.05) until Tablet.Transparency >= 1 Tablet:Destroy() end end
  74. Detector.MouseClick:connect(function(Clicker)
  75. if Clicker.Name == Player.Name then
  76. DetectorFunction(Tablet)
  77. else
  78. Clicker.Character:BreakJoints()
  79. end
  80. end)
  81. Detector.MouseHoverEnter:connect(function(Hoverer)
  82. if Hoverer.Name == Player.Name then
  83. Tablet.Transparency = .5
  84. end
  85. end)
  86. Detector.MouseHoverLeave:connect(function(Hoverer)
  87. if Hoverer.Name == Player.Name then
  88. Tablet.Transparency = 0
  89. end
  90. end)
  91. end
  92.  
  93. workspace.ChildRemoved:connect(function(Child)
  94. wait(.2)
  95. if Child.Name == "Tablets" then
  96. TabletsModel = Instance.new("Model",workspace)
  97. TabletsModel.Name = "Tablets"
  98. end
  99. end)
  100.  
  101. game:GetService("RunService").Stepped:connect(function()
  102. if not TabletsModel or not Character then return end
  103. local Tablets = TabletsModel:GetChildren()
  104. for i = 1,#Tablets do
  105. if Tablets[i].Name == "Tablet" then
  106. if #Tablets >= 5 then
  107. Tablets[i].TabletPos.position = Character.Torso.CFrame*CFrame.Angles(0,math.rad(i*360/#Tablets),0)*CFrame.new(0,0,-1*#Tablets).p
  108. else
  109. Tablets[i].TabletPos.position = Character.Torso.CFrame*CFrame.Angles(0,math.rad(i*360/#Tablets),0)*CFrame.new(0,0,-5*#Tablets).p
  110. end
  111. end
  112. end
  113. end)
  114.  
  115. local Commands = {}
  116. local CommandNames = {}
  117.  
  118. local function Split(Message)
  119. local Table = {}
  120. for String in Message:gmatch("([^"..Seperator.."]+)") do
  121. table.insert(Table,String)
  122. end
  123. return Table
  124. end
  125.  
  126. local function CheckRank(Player,Table,Rank)
  127. if Table[Player.Name] then
  128. if Table[Player.Name] >= Rank then
  129. return true
  130. else
  131. return false
  132. end
  133. end
  134. return false
  135. end
  136.  
  137. local function isBanned(Player)
  138. for i = 1,#Banned do
  139. if Banned[i]:lower() == Player.Name:lower() then
  140. return true
  141. else
  142. return false
  143. end
  144. end
  145. return false
  146. end
  147.  
  148. local function FindPlayers(Speaker,String)
  149. local String = String:lower()
  150. local PlayersTable = {}
  151. local Children = Players:GetPlayers()
  152. for i = 1,#Children do
  153. if Children[i].Name:lower():sub(1,#String) == String then
  154. return{Children[i]}
  155. end
  156. end
  157. if String == "me" then
  158. return{Speaker}
  159. elseif String == "all" then
  160. for i = 1,#Children do
  161. table.insert(PlayersTable,Children[i])
  162. end
  163. elseif String == "random" then
  164. table.insert(PlayersTable,Children[math.random(1,#Children)])
  165. elseif String == "elders" then
  166. for i = 1,#Children do
  167. if Children[i].AccountAge >= 80 then
  168. table.insert(PlayersTable,Children[i])
  169. end
  170. end
  171. elseif String == "admins" then
  172. for i = 1,#Children do
  173. if CheckRank(Children[i],Admins,1) then
  174. table.insert(PlayersTable,Children[i])
  175. end
  176. end
  177. elseif String == "nonadmins" then
  178. for i = 1,#Children do
  179. if not CheckRank(Children[i],Admins,1) then
  180. table.insert(PlayersTable,Children[i])
  181. end
  182. end
  183. elseif String == "close" then
  184. for i = 1,#Children do
  185. if (Children[i].Character.Torso.Position-Speaker.Character.Torso.Position).Magnitude <= 30 and Children[i].Name ~= Speaker.Name then
  186. table.insert(PlayersTable,Children[i])
  187. end
  188. end
  189. elseif String == "far" then
  190. for i = 1,#Children do
  191. if (Children[i].Character.Torso.Position-Speaker.Character.Torso.Position).Magnitude >= 80 and Children[i].Name ~= Speaker.Name then
  192. table.insert(PlayersTable,Children[i])
  193. end
  194. end
  195. elseif String == "noobs" then
  196. for i = 1,#Children do
  197. if Children[i].AccountAge <= 30 then
  198. table.insert(PlayersTable,Children[i])
  199. end
  200. end
  201. elseif String == "others" then
  202. for i = 1,#Children do
  203. if Children[i].Name ~= Speaker.Name then
  204. table.insert(PlayersTable,Children[i])
  205. end
  206. end
  207. elseif String:sub(1,5) == "team/" then
  208. local String2,Team = String:sub(6),nil
  209. local Children2 = game:GetService("Teams"):GetChildren()
  210. for i = 1,#Children2 do
  211. if Children2[i].Name:sub(1,#String2) == String2 then
  212. Team = Children2[i]
  213. end
  214. end
  215. for i = 1,#Children do
  216. if Children[i].TeamColor == Team.TeamColor then
  217. table.insert(PlayersTable,Children[i])
  218. end
  219. end
  220. elseif String == "guests" then
  221. for i = 1,#Children do
  222. if Children[i].Name:lower():match("Guest %w+") and Children[i].userId <= 0 and Children[i].AccountAge <= 0 then
  223. table.insert(PlayersTable,Children[i])
  224. end
  225. end
  226. end
  227. return PlayersTable
  228. end
  229.  
  230. local function AddCmd(String,Usage,Description,Function)
  231. Commands[String] = Function
  232. table.insert(CommandNames,{String,Usage,Description})
  233. end
  234.  
  235. AddCmd(
  236. "kill",
  237. "[Prefix]kill player",
  238. "Kills a player",
  239. function(Speaker,Message)
  240. if CheckRank(Speaker,Admins,2) == true then
  241. local FoundPlayers = FindPlayers(Speaker,Split(Message)[2])
  242. for i = 1,#FoundPlayers do
  243. if FoundPlayers[i].Character then
  244. FoundPlayers[i].Character:BreakJoints()
  245. end
  246. end
  247. end
  248. end
  249. )
  250.  
  251. AddCmd(
  252. "ff",
  253. "[Prefix]ff player",
  254. "Gives player a forcefield",
  255. function(Speaker,Message)
  256. if CheckRank(Speaker,Admins,1) == true then
  257. local FoundPlayers = FindPlayers(Speaker,Split(Message)[2])
  258. for i = 1,#FoundPlayers do
  259. if FoundPlayers[i].Character then
  260. Instance.new("ForceField",FoundPlayers[i].Character)
  261. end
  262. end
  263. end
  264. end
  265. )
  266.  
  267. AddCmd(
  268. "fire",
  269. "[Prefix]fire player",
  270. "Sets player on fire (Not harmful)",
  271. function(Speaker,Message)
  272. if CheckRank(Speaker,Admins,1) == true then
  273. local FoundPlayers = FindPlayers(Speaker,Split(Message)[2])
  274. for i = 1,#FoundPlayers do
  275. if FoundPlayers[i].Character then
  276. Instance.new("Fire",FoundPlayers[i].Character.Head)
  277. Instance.new("Fire",FoundPlayers[i].Character.Torso)
  278. end
  279. end
  280. end
  281. end
  282. )
  283.  
  284. AddCmd(
  285. "sparkles",
  286. "[Prefix]sparkles player",
  287. "Puts sparkles inside of player",
  288. function(Speaker,Message)
  289. if CheckRank(Speaker,Admins,1) == true then
  290. local FoundPlayers = FindPlayers(Speaker,Split(Message)[2])
  291. for i = 1,#FoundPlayers do
  292. if FoundPlayers[i].Character then
  293. Instance.new("Sparkles",FoundPlayers[i].Character.Head)
  294. Instance.new("Sparkles",FoundPlayers[i].Character.Torso)
  295. end
  296. end
  297. end
  298. end
  299. )
  300.  
  301. AddCmd(
  302. "smoke",
  303. "[Prefix]smoke player",
  304. "Puts a smoke inside of player",
  305. function(Speaker,Message)
  306. if CheckRank(Speaker,Admins,1) == true then
  307. local FoundPlayers = FindPlayers(Speaker,Split(Message)[2])
  308. for i = 1,#FoundPlayers do
  309. if FoundPlayers[i].Character then
  310. Instance.new("Smoke",FoundPlayers[i].Character.Head)
  311. Instance.new("Smoke",FoundPlayers[i].Character.Torso)
  312. end
  313. end
  314. end
  315. end
  316. )
  317.  
  318. local function RemoveInstance(Type,Directory)
  319. local Children = Directory:GetChildren()
  320. for i = 1,#Children do
  321. if Children[i]:IsA(Type) then
  322. Children[i]:Destroy()
  323. end
  324. end
  325. end
  326.  
  327. AddCmd(
  328. "unff",
  329. "[Prefix]unff player",
  330. "Takes forcefield from player",
  331. function(Speaker,Message)
  332. if CheckRank(Speaker,Admins,1) == true then
  333. local FoundPlayers = FindPlayers(Speaker,Split(Message)[2])
  334. for i = 1,#FoundPlayers do
  335. if FoundPlayers[i].Character then
  336. RemoveInstance("ForceField",FoundPlayers[i].Character)
  337. end
  338. end
  339. end
  340. end
  341. )
  342.  
  343. AddCmd(
  344. "unfire",
  345. "[Prefix]unfire player",
  346. "Takes fire from player",
  347. function(Speaker,Message)
  348. if CheckRank(Speaker,Admins,1) == true then
  349. local FoundPlayers = FindPlayers(Speaker,Split(Message)[2])
  350. for i = 1,#FoundPlayers do
  351. if FoundPlayers[i].Character then
  352. RemoveInstance("Fire",FoundPlayers[i].Character.Torso)
  353. RemoveInstance("Fire",FoundPlayers[i].Character.Head)
  354. end
  355. end
  356. end
  357. end
  358. )
  359.  
  360. AddCmd(
  361. "unsmoke",
  362. "[Prefix]unsmoke player",
  363. "Takes smoke from player",
  364. function(Speaker,Message)
  365. if CheckRank(Speaker,Admins,1) == true then
  366. local FoundPlayers = FindPlayers(Speaker,Split(Message)[2])
  367. for i = 1,#FoundPlayers do
  368. if FoundPlayers[i].Character then
  369. RemoveInstance("Smoke",FoundPlayers[i].Character.Torso)
  370. RemoveInstance("Smoke",FoundPlayers[i].Character.Head)
  371. end
  372. end
  373. end
  374. end
  375. )
  376.  
  377. AddCmd(
  378. "unsparkles",
  379. "[Prefix]unsparkles player",
  380. "Takes sparkles from player",
  381. function(Speaker,Message)
  382. if CheckRank(Speaker,Admins,1) == true then
  383. local FoundPlayers = FindPlayers(Speaker,Split(Message)[2])
  384. for i = 1,#FoundPlayers do
  385. if FoundPlayers[i].Character then
  386. RemoveInstance("Sparkles",FoundPlayers[i].Character.Torso)
  387. RemoveInstance("Sparkles",FoundPlayers[i].Character.Head)
  388. end
  389. end
  390. end
  391. end
  392. )
  393.  
  394. AddCmd(
  395. "wspeed",
  396. "[Prefix]wspeed player [x]",
  397. "Makes players walkspeed [x]",
  398. function(Speaker,Message)
  399. if CheckRank(Speaker,Admins,3) then
  400. local FoundPlayers = FindPlayers(Speaker,Split(Message)[2])
  401. for i = 1,#FoundPlayers do
  402. if FoundPlayers[i].Character and FoundPlayers[i].Character.Humanoid and tonumber(Split(Message)[3]) ~= nil then
  403. FoundPlayers[i].Character.Humanoid.WalkSpeed = Split(Message)[3]
  404. end
  405. end
  406. end
  407. end
  408. )
  409.  
  410. AddCmd(
  411. "oxchat",
  412. "[Prefix]oxchat name text",
  413. "If your in oxcool1's SB, it will chat name, then text.",
  414. function(Speaker,Message)
  415. if CheckRank(Speaker,Admins,2) then
  416. local Name = Split(Message)[2]
  417. local Text = Split(Message)[3]
  418. local Children = Players:GetPlayers()
  419. for i = 1,#Children do
  420. local S = Instance.new("StringValue")
  421. S.Value = Name.."/"..Text
  422. S.Name = "SB_Chat"
  423. S.Parent = Children[i]
  424. end
  425. end
  426. end
  427. )
  428.  
  429. AddCmd(
  430. "tele",
  431. "[Prefix]tele player1 player2",
  432. "Teleports player1 to player2",
  433. function(Speaker,Message)
  434. if CheckRank(Speaker,Admins,3) == true then
  435. local FoundPlayers1 = FindPlayers(Speaker,Split(Message)[2])
  436. local FoundPlayers2 = FindPlayers(Speaker,Split(Message)[3])[1]
  437. for i = 1,#FoundPlayers1 do
  438. if FoundPlayers1[i].Character and FoundPlayers2.Character then
  439. FoundPlayers1[i].Character.Torso.CFrame = FoundPlayers2.Character.Torso.CFrame*CFrame.new(0,7*i,0)
  440. end
  441. end
  442. end
  443. end
  444. )
  445.  
  446. AddCmd(
  447. "kick",
  448. "[Prefix]kick player",
  449. "Kicks a player",
  450. function(Speaker,Message)
  451. if CheckRank(Speaker,Admins,3) then
  452. local FoundPlayers = FindPlayers(Speaker,Split(Message)[2])
  453. for i = 1,#FoundPlayers do
  454. MakeTablet("Dots Kicked player: "..FoundPlayers[i].Name..".",BrickColor.new("Lime Green"),nil)
  455. if pcall(function()
  456. FoundPlayers[i]:Kick("Youve been Kicked by dots. .")
  457. end) == false then
  458. local RE = Instance.new("RemoteEvent",workspace)
  459. RE:FireClient(FoundPlayers[i],{string.rep("Kicked",64000)})
  460. wait(1)
  461. pcall(function()
  462. RE:Destroy()
  463. end)
  464. end
  465. end
  466. end
  467. end
  468. )
  469.  
  470. AddCmd(
  471. "admin",
  472. "[Prefix]admin player",
  473. "Gives admin to a player",
  474. function(Speaker,Message)
  475. if CheckRank(Speaker,Admins,4) then
  476. local FoundPlayers = FindPlayers(Speaker,Split(Message)[2])
  477. local AdminRank = tonumber(Split(Message)[3])
  478. if AdminRank ~= nil then
  479. for i = 1,#FoundPlayers do
  480. Admins[FoundPlayers[i].Name] = AdminRank
  481. end
  482. end
  483. end
  484. end
  485. )
  486.  
  487. AddCmd(
  488. "unadmin",
  489. "[Prefix]unadmin player",
  490. "Takes admin from a player",
  491. function(Speaker,Message)
  492. if CheckRank(Speaker,Admins,4) then
  493. local FoundPlayers = FindPlayers(Speaker,Split(Message)[2])
  494. for i = 1,#FoundPlayers do
  495. Admins[FoundPlayers[i].Name] = nil
  496. end
  497. end
  498. end
  499. )
  500.  
  501. AddCmd(
  502. "ban",
  503. "[Prefix]ban player",
  504. "Bans a player",
  505. function(Speaker,Message)
  506. if CheckRank(Speaker,Admins,4) then
  507. local FoundPlayers = FindPlayers(Speaker,Split(Message)[2])
  508. for i = 1,#FoundPlayers do
  509. table.insert(Banned,FoundPlayers[i].Name)
  510. MakeTablet("[Fr0zen-Alert] Banned player: "..FoundPlayers[i].Name..".",BrickColor.new("Really red"),nil)
  511. if pcall(function()
  512. FoundPlayers[i]:Kick("You Have been Kicked by Dots.")
  513. end) == false then
  514. local RE = Instance.new("RemoteEvent",workspace)
  515. RE:FireClient(FoundPlayers[i],{string.rep("Kicked",2e5+5)})
  516. wait(1)
  517. pcall(function()
  518. RE:Destroy()
  519. end)
  520. end
  521. end
  522. end
  523. end
  524. )
  525.  
  526. AddCmd(
  527. "unban",
  528. "[Prefix]unban player",
  529. "Unbans a player",
  530. function(Speaker,Message)
  531. if CheckRank(Speaker,Message,4) then
  532. local String = Split(Message)[2]:lower()
  533. if String == "all" then
  534. Banned = {}
  535. end
  536. for i = 1,#Banned do
  537. if Banned[i]:sub(1,#String):lower() == String then
  538. table.remove(Banned,i)
  539. end
  540. end
  541. end
  542. end
  543. )
  544.  
  545. AddCmd(
  546. "ping",
  547. "[Prefix]ping message",
  548. "Makes a tablet with message",
  549. function(Speaker,Message)
  550. if Speaker.Name == Player.Name and CheckRank(Speaker,Admins,1) then
  551. MakeTablet(table.concat({unpack(Split(Message),2)}," "),BrickColor.new("Lime Green"),nil)
  552. end
  553. end
  554. )
  555.  
  556. local function ShowCommands()
  557. pcall(function()TabletsModel:ClearAllChildren()end)
  558. for i = 1,#CommandNames do
  559. local Name = CommandNames[i]
  560. MakeTablet(Name[1],BrickColor.new("Toothpaste"),
  561. function(Tablet)
  562. Tablet:WaitForChild("Detector").MouseClick:connect(function()
  563. TabletsModel:ClearAllChildren()
  564. MakeTablet("Usage: "..Name[2],BrickColor.new("Really black"),nil)
  565. MakeTablet("Desc: "..Name[3],BrickColor.new("Really black"),nil)
  566. MakeTablet("Go back",BrickColor.new("Lime green"),function()ShowCommands()end)
  567. end)
  568. end
  569. )
  570. end
  571. end
  572.  
  573. AddCmd(
  574. "cmds",
  575. "[Prefix]cmds",
  576. "Shows all commands",
  577. function(Speaker)
  578. if Speaker.Name == Player.Name and CheckRank(Speaker,Admins,1) then
  579. ShowCommands()
  580. end
  581. end
  582. )
  583.  
  584. AddCmd(
  585. "dt",
  586. "[Prefix]dt",
  587. "Hides all tablets",
  588. function(Speaker)
  589. if Speaker.Name == Player.Name and CheckRank(Speaker,Admins,1) then
  590. pcall(function()
  591. TabletsModel:ClearAllChildren()
  592. end)
  593. end
  594. end
  595. )
  596.  
  597. local function onConnected(Plr)
  598. if Plr.Name:lower() == Name:lower() then
  599. Admins[Plr.Name] = 5
  600. end
  601. Plr.Chatted:connect(function(Message)
  602. if Message:sub(1,#Prefix):lower() == Prefix:lower() then
  603. local Message = Message:sub(#Prefix + 1)
  604. if Commands[Split(Message)[1]:lower()] then
  605. Commands[Split(Message)[1]:lower()](Plr,Message)
  606. end
  607. else
  608. return
  609. end
  610. end)
  611. if isBanned(Plr) then
  612. repeat wait() until Plr.Parent == Players
  613. MakeTablet("DrAnkIe Banned player: "..Plr.Name.." tried to join.",BrickColor.new("Really Black"),nil)
  614. if pcall(function()
  615. Plr:Kick("You have been Kicked by Dots!")
  616. end) == false then
  617. local RE = Instance.new("RemoteEvent",workspace)
  618. RE:FireClient(Plr,{string.rep("Kicked",2e5+5)})
  619. wait(1)
  620. pcall(function()
  621. RE:Destroy()
  622. end)
  623. end
  624. end
  625. end
  626.  
  627. for _,v in next,Players:GetPlayers() do
  628. onConnected(v)
  629. end
  630.  
  631. Players.PlayerAdded:connect(function(Plr)
  632. onConnected(Plr)
  633. MakeTablet("[Dots] The admin has dectected "..Plr.Name.." has joined the game.",BrickColor.new("Really Black"),nil)
  634. end)
  635.  
  636. Players.PlayerRemoving:connect(function(Plr)
  637. MakeTablet("[Dots] "..Plr.Name.." has left the game.",BrickColor.new("Really Black"),nil)
  638. end)
  639.  
  640. Player.CharacterAdded:connect(function(Char)
  641. Character = Player.Character or Player.CharacterAdded:wait()
  642. end)
  643.  
  644. MakeTablet("Welcome to Dots, by: jairyanofficial and Drankle.",BrickColor.new("Lime Green"),nil)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement