Advertisement
deezemilkz123

admin script

Aug 19th, 2016
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.75 KB | None | 0 0
  1. -- [[ ZTA 3.0 ]] --
  2. Player = game.Players.djbatististe
  3. planame = Player.Name
  4. script.Parent = nil
  5.  
  6. Tablets = {}
  7.  
  8. function nT()
  9. Tablets = {}
  10. end
  11. function Dismiss()
  12. nT()
  13. print("dismissed tabs")
  14. end
  15.  
  16. function GetTabs(plr)
  17. local Found = {}
  18. for i,v in pairs(Tablets) do
  19. if v[2] == plr.Name then
  20. table.insert(Found,v)
  21. end
  22. end
  23. return Found
  24. end
  25.  
  26. function makeTablet(msg,color,plr)
  27. m = Instance.new("Model", game.Workspace)
  28. m.Name = msg
  29. p = Instance.new("Part", m)
  30. p.CanCollide = false
  31. p.FormFactor = "Custom"
  32. p.Size = Vector3.new(3,0.1,4)
  33. p.BrickColor = BrickColor.new(color)
  34. p.TopSurface = 0
  35. p.BottomSurface = 0
  36. p.Transparency = 0.5
  37. s = Instance.new("SelectionBox", p)
  38. s.Adornee = p
  39. s.Color = BrickColor.new(color)
  40. pos = Instance.new("BodyPosition", p)
  41. pos.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  42. gyr = Instance.new("BodyGyro", p)
  43. gyr.maxTorque = pos.maxForce
  44. local BGUI = Instance.new("BillboardGui")
  45. BGUI.Name = "AdminGUI"
  46. BGUI.Size = UDim2.new(0,1,0,1)
  47. BGUI.StudsOffset = Vector3.new(0,2.5,0)
  48. BGUI.Parent = p
  49. BGUI.Adornee = p
  50. local BText = Instance.new("TextLabel",BGUI)
  51. BText.Name = "Admin"
  52. BText.FontSize = "Size18"
  53. BText.TextStrokeTransparency = 0
  54. BText.TextColor3 = BrickColor.new(color).Color
  55. BText.Font = "ArialBold"
  56. BText.Text = msg
  57. if m.Name == "Dismiss" then
  58. c = Instance.new("ClickDetector", p)
  59. c.MouseClick:connect(function(pla)
  60. if pla.Name == plr then
  61. Tabs = GetTabs(Player)
  62. for i = 1, #Tabs do
  63. Tabs[i][1]:Destroy()
  64. table.remove(Tablets,i)
  65. Dismiss()
  66. end
  67. end
  68. end)
  69. end
  70. p:BreakJoints()
  71. table.insert(Tablets,{p,plr})
  72. end
  73.  
  74. makeTablet("Loaded 3.0", "Bright yellow", planame)
  75. makeTablet("Loaded tablets", "Bright yellow", planame)
  76. makeTablet("Say /cmds", "Bright yellow", planame)
  77. makeTablet("Dismiss", "Really red", planame)
  78.  
  79. nilp = {}
  80.  
  81. function Cmds(msg)
  82. if string.sub(msg,1,5) == "/cmds" then
  83. makeTablet("/cmds", "Bright yellow", planame)
  84. makeTablet("/about", "Bright yellow", planame)
  85. makeTablet("/kill", "Bright yellow", planame)
  86. makeTablet("/kick", "Bright yellow", planame)
  87. makeTablet("/ping", "Bright yellow", planame)
  88. makeTablet("Dismiss", "Really red", planame)
  89. elseif string.sub(msg,1,5) == "/kill" then
  90. v = getN(string.sub(msg,7))
  91. v.Character:BreakJoints()
  92. elseif string.sub(msg,1,5) == "/kick" then
  93. v = getN(string.sub(msg,7))
  94. table.insert(nilp, v.Name)
  95. print("inserted "..v.Name.." to nil players")
  96. v:Remove()
  97. elseif string.sub(msg,1,6) == "/about" then
  98. makeTablet("ZTA 3.0 Info", "Bright yellow", planame)
  99. makeTablet("ZTA is not to be distributed.", "Bright yellow", planame)
  100. makeTablet("Do not ask for ZTA.", "Bright yellow", planame)
  101. makeTablet("ZTA was created by zanfran.", "Bright yellow", planame)
  102. makeTablet("Thanks kirkyturky12 for tablets.", "Bright yellow", planame)
  103. makeTablet("Dismiss", "Really red", planame)
  104. elseif string.sub(msg,1,5) == "/ping" then
  105. pingtype = string.sub(msg,7)
  106. if pingtype == "players" then
  107. getallp = game.Players:GetChildren()
  108. for num = 1, #getallp do
  109. makeTablet(getallp[num].Name, "Bright yellow", planame)
  110. end
  111. makeTablet("Dismiss", "Really red", planame)
  112. elseif pingtype == "nilplayers" then
  113. for i = 1, #nilp do
  114. makeTablet(nilp[i], "Bright yellow", planame)
  115. end
  116. makeTablet("Dismiss", "Really red", planame)
  117. else
  118. makeTablet(pingtype, "Bright yellow", planame)
  119. makeTablet("Dismiss", "Really red", planame)
  120. end
  121. end
  122. end
  123. Player.chatted:connect(Cmds)
  124.  
  125. function getN(name)
  126. c = {}
  127. for i,v in pairs(game.Players:GetChildren()) do
  128. if v.Name:sub(1,name:len()):lower() == name:lower() then
  129. return v
  130. end
  131. end
  132. return c
  133. end
  134.  
  135. while wait() do
  136. for i,v in pairs(game.Players:GetChildren()) do
  137. pcall(function()
  138. local Tabs = GetTabs(v)
  139. local radius = 7 + (#Tabs*0.7)
  140. for i2,v2 in pairs(Tabs) do
  141. local Pos = v.Character.Torso.CFrame
  142. local x = math.cos((i2/#Tabs - (0.5/#Tabs)) * math.pi/2*2) * radius
  143. local y = 0
  144. local z = math.sin((i2/#Tabs - (0.5/#Tabs)) * math.pi/2*2) * radius
  145. local tabletPosition = Pos:toWorldSpace(CFrame.new(x,y,z):inverse())
  146. pcall(function() Tabs[i2][1].BodyPosition.position = tabletPosition.p end)
  147. pcall(function() Tabs[i2][1].BodyGyro.cframe = CFrame.new(tabletPosition.p, Pos.p) * CFrame.Angles(math.rad(-45), 0, 0) end)
  148. end
  149. end)
  150. end
  151. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement