Guest User

Untitled

a guest
Jul 28th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.69 KB | None | 0 0
  1. -- In this library, you'll be making a client admin.
  2. -- Meaning that it will be smoother and only you can use it.
  3. -- Remember, this is only a library.
  4. -- It will help you make an admin, not give you an entire admin.
  5. -- So you will need to add all the ban features and all that.
  6. -- Behold! Tablet Library Version 1!
  7.  
  8. -- THIS IS LOCAL!!!!! I cannot express that enough!
  9.  
  10.  
  11. -- Assigning Variables
  12.  
  13. local Player = Game:GetService("Players").LocalPlayer; -- The Player
  14. local Character = Player.Character;
  15. local Torso = Character:WaitForChild"Torso";
  16. local Tablets = {};
  17. local Commands = {};
  18. local Rotation = 0;
  19. local RotationIncrease = 0.1;
  20.  
  21. -- OnChatted (For Commands - Don't Touch!)
  22. function OnChatted(Message)
  23. local Command = ""
  24. for i,v in pairs(Commands)do
  25. if Message:sub(1,v.Cmd:len()):lower() == v.Cmd and Command == "" then
  26. Command = v.Cmd
  27. Spawn(function()
  28. a,b = pcall(function()
  29. v.Func(Message:sub(v.Cmd:len()+1):lower())
  30. end)
  31. if not a then
  32. error(b)
  33. end
  34. end)
  35. end
  36. end
  37. end
  38. -- More Commands!
  39. function AddCommand(Command,Description,Example,Function)
  40. table.insert(Commands,{Cmd=Command,Desc=Description,Example=Example,Func=Function});
  41. end
  42. -- Output! Time to design your tablets!
  43. function Output(Text,Colour,Function)
  44. local part = Instance.new("Part",workspace)
  45. part.Anchored = true
  46. part.FormFactor = "Custom"
  47. part.Size = Vector3.new(2.3,2.3,2.3)
  48. part.Transparency = 0.5
  49. part.CanCollide = false
  50. part.BrickColor = BrickColor.new(Colour)
  51. part.CFrame = CFrame.new(Torso.CFrame.p)
  52. part.TopSurface,part.BottomSurface = 0,0
  53. local bg = Instance.new("BodyGyro", part)
  54. bg.maxTorque = Vector3.new(1/0,1/0,1/0)
  55. local sel = Instance.new('SelectionBox',part)
  56. sel.Adornee = part
  57. sel.Color = part.BrickColor
  58. sel.Transparency = 0.7
  59. local bg = Instance.new("BillboardGui",part)
  60. bg.Enabled = true
  61. bg.Adornee = part
  62. bg.AlwaysOnTop = true
  63. bg.Size = UDim2.new(1,0,1,0)
  64. bg.ExtentsOffset = Vector3.new(0,2,0)
  65. local text = Instance.new("TextLabel",bg)
  66. text.Text = Text
  67. text.Size = UDim2.new(1,0,1,0)
  68. text.BackgroundTransparency = 1
  69. text.Font = "Arial"
  70. text.FontSize = "Size14"
  71. text.TextStrokeTransparency = 0.7
  72. text.TextStrokeColor3 = Color3.new(0,0,0);
  73. text.TextColor3 = part.BrickColor.Color
  74. local point = Instance.new("PointLight",part)
  75. point.Brightness = 1/0
  76. point.Color = part.BrickColor.Color
  77. point.Range = 6
  78. local click = Instance.new("ClickDetector",part)
  79. click.MaxActivationDistance = 1/0
  80. coroutine.resume(coroutine.create(function()
  81. if Text == "Dismiss" then
  82. col = 21
  83. part.BrickColor = BrickColor.new(col)
  84. text.TextColor3 = part.BrickColor.Color
  85. sel.Color = part.BrickColor
  86. elseif Text == "Back" then
  87. col = 1010
  88. part.BrickColor = BrickColor.new(col)
  89. text.TextColor3 = part.BrickColor.Color
  90. sel.Color = part.BrickColor
  91. end
  92. click.MouseClick:connect(function(p)
  93. if p == Player then
  94. if Function == nil then
  95. pcall(function()
  96. coroutine.resume(coroutine.create(function()
  97. local Tabs = Tablets
  98. for i,v in pairs(Tabs) do
  99. if v==part then
  100. table.remove(Tabs,i)
  101. end
  102. end
  103. part:Destroy()
  104. end))
  105. end)
  106. else
  107. pcall(function()
  108. coroutine.resume(coroutine.create(function()
  109. local a,b = coroutine.resume(coroutine.create(function()
  110. Function();
  111. end))
  112. if a then
  113. return
  114. else
  115. Output(b,21)
  116. end
  117. local Tabs = Tablets
  118. for i,v in pairs(Tabs) do
  119. if v==part then
  120. table.remove(Tabs,i)
  121. end
  122. end
  123. part:Destroy()
  124. end))
  125. end)
  126. end
  127. end
  128. end)
  129. end))
  130. pcall(function()
  131. table.insert(Tablets,part)
  132. end)
  133. end
  134. -- Rotation (DON'T TOUCH)
  135. function UpdateTablets()
  136. Rotation = Rotation + RotationIncrease
  137. for i,v in pairs(Tablets)do
  138. if not v.Parent then table.remove(Tablets,i) return nil end
  139. local TorsoPosition = CFrame.new(Torso.CFrame.p);
  140. local CFR = TorsoPosition * CFrame.Angles(0,math.rad((i*(360/#Tablets)+Rotation)),0)
  141. CFR = CFR * CFrame.new(0,0,1.5+(#Tablets))
  142. local LerpedCFR = v.Position
  143. LerpedCFR = LerpedCFR:Lerp(CFR.p,.1)
  144. v.CFrame = CFrame.new(LerpedCFR)
  145. end
  146. end
  147. -- Adding Functions (I'll give ya one)
  148. function RemoveTablets()
  149. for o,p in pairs(Tablets)do
  150. for i,v in pairs(Tablets)do
  151. wait(0)
  152. pcall(function()
  153. table.remove(Tablets,i)
  154. v:Destroy()
  155. end)
  156. end
  157. end
  158. end
  159. -- Adding Commands (I'll give you three commands)
  160. AddCommand("ff;","Gives a player a forcefield","ff;12packkid",function(Message)
  161. for i,v in pairs(Game:GetService("Players"):GetPlayers())do
  162. if v.Name:lower():find(Message:lower())then
  163. pcall(function()
  164. Instance.new('ForceField',v.Character);
  165. Output("Gave a forcefield to "..v.Name,1020);
  166. end)
  167. end
  168. end
  169. end)
  170. AddCommand("unff;","Remove(s) (all) forcefields from a player","unff;12packkid",function(Message)
  171. for i,v in pairs(Game:GetService("Players"):GetPlayers())do
  172. if v.Name:lower():find(Message:lower())then
  173. pcall(function()
  174. local ForceFields = {};
  175. for i,v in pairs(v.Character:GetChildren())do
  176. if v:IsA"ForceField" then
  177. table.insert(ForceFields,v)
  178. end
  179. end
  180. if #ForceFields == 0 then
  181. Output(v.Name.." doesn't have any forcefields!",21);
  182. else
  183. Output("Removed "..tostring(#ForceFields).." forcefield(s) from "..v.Name,1020)
  184. for i,v in pairs(ForceFields) do
  185. v:Destroy()
  186. end
  187. end
  188. end)
  189. end
  190. end
  191. end)
  192. AddCommand("dt;","Dismisses the tablets!","dt;",function(Message)
  193. RemoveTablets();
  194. end)
  195. AddCommand("audio;","Plays an audio!","audio;id",function(Message)
  196. pcall(function()
  197. for i,v in pairs(Workspace:GetChildren())do
  198. if v:IsA"Sound" then
  199. v:Stop()
  200. v:Destroy()
  201. end
  202. end
  203. local Sound = Instance.new("Sound",Workspace)
  204. Sound.SoundId = "rbxassetid://"..Message
  205. Sound.Volume = 1
  206. wait(0)
  207. Sound:Play()
  208. Output("Song Playing: "..Message,1020)
  209. end)
  210. end)
  211. AddCommand("stop;","Stops all audios in Workspace","stop;",function(Message)
  212. pcall(function()
  213. local Sounds = {}
  214. for i,v in pairs(Workspace:GetChildren())do
  215. if v:IsA"Sound" then
  216. table.insert(Sounds,v)
  217. end
  218. end
  219. if #Sounds == 0 then
  220. Output("There are no sounds in Workspace",21)
  221. else
  222. Output("Stopped all sounds in Workspace!",1020)
  223. for i,v in pairs(Sounds)do
  224. v:Stop()
  225. v:Destroy()
  226. end
  227. end
  228. end)
  229. end)
  230. Player.Chatted:connect(OnChatted)
  231.  
  232. Output("Welcome to 12packkid's Tablet Making Kit Version 1!",1020)
  233. Output("This has 5 commands, which you can see in the script's source",1020)
  234. Output("Hope you have fun, "..Player.Name.."! ~12packkid",1020)
  235. coroutine.resume(coroutine.create(function()
  236. Game:GetService("RunService").RenderStepped:connect(function()
  237. UpdateTablets()
  238. end)
  239. end))
Add Comment
Please, Sign In to add comment