Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- In this library, you'll be making a client admin.
- -- Meaning that it will be smoother and only you can use it.
- -- Remember, this is only a library.
- -- It will help you make an admin, not give you an entire admin.
- -- So you will need to add all the ban features and all that.
- -- Behold! Tablet Library Version 1!
- -- THIS IS LOCAL!!!!! I cannot express that enough!
- -- Assigning Variables
- local Player = Game:GetService("Players").LocalPlayer; -- The Player
- local Character = Player.Character;
- local Torso = Character:WaitForChild"Torso";
- local Tablets = {};
- local Commands = {};
- local Rotation = 0;
- local RotationIncrease = 0.1;
- -- OnChatted (For Commands - Don't Touch!)
- function OnChatted(Message)
- local Command = ""
- for i,v in pairs(Commands)do
- if Message:sub(1,v.Cmd:len()):lower() == v.Cmd and Command == "" then
- Command = v.Cmd
- Spawn(function()
- a,b = pcall(function()
- v.Func(Message:sub(v.Cmd:len()+1):lower())
- end)
- if not a then
- error(b)
- end
- end)
- end
- end
- end
- -- More Commands!
- function AddCommand(Command,Description,Example,Function)
- table.insert(Commands,{Cmd=Command,Desc=Description,Example=Example,Func=Function});
- end
- -- Output! Time to design your tablets!
- function Output(Text,Colour,Function)
- local part = Instance.new("Part",workspace)
- part.Anchored = true
- part.FormFactor = "Custom"
- part.Size = Vector3.new(2.3,2.3,2.3)
- part.Transparency = 0.5
- part.CanCollide = false
- part.BrickColor = BrickColor.new(Colour)
- part.CFrame = CFrame.new(Torso.CFrame.p)
- part.TopSurface,part.BottomSurface = 0,0
- local bg = Instance.new("BodyGyro", part)
- bg.maxTorque = Vector3.new(1/0,1/0,1/0)
- local sel = Instance.new('SelectionBox',part)
- sel.Adornee = part
- sel.Color = part.BrickColor
- sel.Transparency = 0.7
- local bg = Instance.new("BillboardGui",part)
- bg.Enabled = true
- bg.Adornee = part
- bg.AlwaysOnTop = true
- bg.Size = UDim2.new(1,0,1,0)
- bg.ExtentsOffset = Vector3.new(0,2,0)
- local text = Instance.new("TextLabel",bg)
- text.Text = Text
- text.Size = UDim2.new(1,0,1,0)
- text.BackgroundTransparency = 1
- text.Font = "Arial"
- text.FontSize = "Size14"
- text.TextStrokeTransparency = 0.7
- text.TextStrokeColor3 = Color3.new(0,0,0);
- text.TextColor3 = part.BrickColor.Color
- local point = Instance.new("PointLight",part)
- point.Brightness = 1/0
- point.Color = part.BrickColor.Color
- point.Range = 6
- local click = Instance.new("ClickDetector",part)
- click.MaxActivationDistance = 1/0
- coroutine.resume(coroutine.create(function()
- if Text == "Dismiss" then
- col = 21
- part.BrickColor = BrickColor.new(col)
- text.TextColor3 = part.BrickColor.Color
- sel.Color = part.BrickColor
- elseif Text == "Back" then
- col = 1010
- part.BrickColor = BrickColor.new(col)
- text.TextColor3 = part.BrickColor.Color
- sel.Color = part.BrickColor
- end
- click.MouseClick:connect(function(p)
- if p == Player then
- if Function == nil then
- pcall(function()
- coroutine.resume(coroutine.create(function()
- local Tabs = Tablets
- for i,v in pairs(Tabs) do
- if v==part then
- table.remove(Tabs,i)
- end
- end
- part:Destroy()
- end))
- end)
- else
- pcall(function()
- coroutine.resume(coroutine.create(function()
- local a,b = coroutine.resume(coroutine.create(function()
- Function();
- end))
- if a then
- return
- else
- Output(b,21)
- end
- local Tabs = Tablets
- for i,v in pairs(Tabs) do
- if v==part then
- table.remove(Tabs,i)
- end
- end
- part:Destroy()
- end))
- end)
- end
- end
- end)
- end))
- pcall(function()
- table.insert(Tablets,part)
- end)
- end
- -- Rotation (DON'T TOUCH)
- function UpdateTablets()
- Rotation = Rotation + RotationIncrease
- for i,v in pairs(Tablets)do
- if not v.Parent then table.remove(Tablets,i) return nil end
- local TorsoPosition = CFrame.new(Torso.CFrame.p);
- local CFR = TorsoPosition * CFrame.Angles(0,math.rad((i*(360/#Tablets)+Rotation)),0)
- CFR = CFR * CFrame.new(0,0,1.5+(#Tablets))
- local LerpedCFR = v.Position
- LerpedCFR = LerpedCFR:Lerp(CFR.p,.1)
- v.CFrame = CFrame.new(LerpedCFR)
- end
- end
- -- Adding Functions (I'll give ya one)
- function RemoveTablets()
- for o,p in pairs(Tablets)do
- for i,v in pairs(Tablets)do
- wait(0)
- pcall(function()
- table.remove(Tablets,i)
- v:Destroy()
- end)
- end
- end
- end
- -- Adding Commands (I'll give you three commands)
- AddCommand("ff;","Gives a player a forcefield","ff;12packkid",function(Message)
- for i,v in pairs(Game:GetService("Players"):GetPlayers())do
- if v.Name:lower():find(Message:lower())then
- pcall(function()
- Instance.new('ForceField',v.Character);
- Output("Gave a forcefield to "..v.Name,1020);
- end)
- end
- end
- end)
- AddCommand("unff;","Remove(s) (all) forcefields from a player","unff;12packkid",function(Message)
- for i,v in pairs(Game:GetService("Players"):GetPlayers())do
- if v.Name:lower():find(Message:lower())then
- pcall(function()
- local ForceFields = {};
- for i,v in pairs(v.Character:GetChildren())do
- if v:IsA"ForceField" then
- table.insert(ForceFields,v)
- end
- end
- if #ForceFields == 0 then
- Output(v.Name.." doesn't have any forcefields!",21);
- else
- Output("Removed "..tostring(#ForceFields).." forcefield(s) from "..v.Name,1020)
- for i,v in pairs(ForceFields) do
- v:Destroy()
- end
- end
- end)
- end
- end
- end)
- AddCommand("dt;","Dismisses the tablets!","dt;",function(Message)
- RemoveTablets();
- end)
- AddCommand("audio;","Plays an audio!","audio;id",function(Message)
- pcall(function()
- for i,v in pairs(Workspace:GetChildren())do
- if v:IsA"Sound" then
- v:Stop()
- v:Destroy()
- end
- end
- local Sound = Instance.new("Sound",Workspace)
- Sound.SoundId = "rbxassetid://"..Message
- Sound.Volume = 1
- wait(0)
- Sound:Play()
- Output("Song Playing: "..Message,1020)
- end)
- end)
- AddCommand("stop;","Stops all audios in Workspace","stop;",function(Message)
- pcall(function()
- local Sounds = {}
- for i,v in pairs(Workspace:GetChildren())do
- if v:IsA"Sound" then
- table.insert(Sounds,v)
- end
- end
- if #Sounds == 0 then
- Output("There are no sounds in Workspace",21)
- else
- Output("Stopped all sounds in Workspace!",1020)
- for i,v in pairs(Sounds)do
- v:Stop()
- v:Destroy()
- end
- end
- end)
- end)
- Player.Chatted:connect(OnChatted)
- Output("Welcome to 12packkid's Tablet Making Kit Version 1!",1020)
- Output("This has 5 commands, which you can see in the script's source",1020)
- Output("Hope you have fun, "..Player.Name.."! ~12packkid",1020)
- coroutine.resume(coroutine.create(function()
- Game:GetService("RunService").RenderStepped:connect(function()
- UpdateTablets()
- end)
- end))
Add Comment
Please, Sign In to add comment