Advertisement
DigitalZer3

Untitled

Oct 10th, 2015
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.98 KB | None | 0 0
  1. --GUARDIAN GEN 1--
  2.  
  3. local GUAR;
  4.  
  5. GUAR = {
  6. Ranks = {
  7. [5] = "Creator";
  8. [4] = "Best Friend";
  9. [3] = "Super Mod";
  10. [2] = "Mod";
  11. [1] = "Player";
  12. [0] = "Guest";
  13. [-1] = "Banned";
  14. };
  15. Ranked = {
  16. {["Name"] = "DigitalZer3", ["Rank"] = 5, ["Reason"] = "Creator", ["Color"] = "Lime green"};
  17. {["Name"] = "KingRedDragon", ["Rank"] = 4, ["Reason"] = "Best Friend", ["Color"] = "Bright red"};
  18. {["Name"] = "justinn3317", ["Rank"] = 3, ["Reason"] = "Friend irl", ["Color"] = "Bright blue"};
  19. };
  20. BannedFromGuardian = {["Name"] = "Admin";["BannedRank"] = -1, ["BannedReason"] = "idk", ["BannedColor"] = "Really black"};
  21.  
  22. Commands = {};
  23. Tablets = {};
  24. Prefix = '<';
  25. Suffix = '';
  26. Services = {
  27. Players = game:service'Players';
  28. Workspace = game:service'Workspace';
  29. Http = game:service'HttpService';
  30. Lighting = game:service'Lighting';
  31. Debris = game:service'Debris';
  32. RunService = game:service'RunService';
  33. };
  34. TabSettings = {
  35. Neon = true;
  36. Wires = false;
  37. TabletSize = 2;
  38. Size = Vector3.new(1.8, 1.8, 1.8);
  39. Size2 = Vector3.new(2, 2, 2);
  40. Rotation = 0;
  41. };
  42.  
  43.  
  44. };
  45. Dismiss = function(Player)
  46. table.foreach(GUAR.Tablets,function(i,v)
  47. if v.Player == Player then
  48. spawn(function()
  49. for _ = 0, .3, 0.01 do
  50. v.Text.TextStrokeTransparency = v.Text.TextStrokeTransparency + .1
  51. v.Text.TextTransparency = v.Text.TextTransparency + .1
  52. v.Tab.Size = v.Tab.Size - Vector3.new(.1, .1, .1)
  53. --v.Tab2.Transparency = v.Tab2.Transparency + .1
  54. v.Tab.Transparency = v.Tab.Transparency + .05
  55. game['Run Service'].Heartbeat:wait()
  56. end--MESSY CODE >.>
  57. --//table.remove(ENF.Tablets, i)
  58. v.Tab:Destroy()
  59. --//v.Tab2:Destroy()
  60. --v.Tab2:Destroy()
  61. end)
  62. end-- u r an st00pid
  63. end)
  64. end;
  65. getRank = function(plr)
  66. if type(plr) == "userdata" then
  67. plr = plr.Name
  68. elseif type(plr) == "string" then
  69. plr = plr
  70. else
  71. plr = tostring(plr)
  72. end;
  73. for i,v in pairs(GUAR.Ranked) do
  74. if v.Name == plr then
  75. return v.Rank;
  76. end;
  77. end;
  78. return 1;
  79. end;
  80. getColor = function(plr)
  81. if type(plr) == "userdata" then
  82. plr = plr.Name
  83. elseif type(plr) == "string" then
  84. plr = plr
  85. else
  86. plr = tostring(plr)
  87. end;
  88. for i,v in pairs(GUAR.Ranked) do
  89. if v.Name == plr then
  90. return v['Color'];
  91. end;
  92. end;
  93. return 'Hot pink';
  94. end;
  95. setRank = function(plr, rank)
  96. if type(plr) == "userdata" then
  97. plr = plr.Name
  98. elseif type(plr) == "string" then
  99. plr = plr
  100. else
  101. plr = tostring(plr)
  102. end;
  103. for i,v in pairs(GUAR.Ranked) do
  104. if v.Name == plr then
  105. v.Rank = tonumber(rank)
  106. end;
  107. end;
  108. end;
  109. setColor = function(plr, clr)
  110. if type(plr) == "userdata" then
  111. plr = plr.Name
  112. elseif type(plr) == "string" then
  113. plr = plr
  114. else
  115. plr = tostring(plr)
  116. end;
  117. for i,v in pairs(GUAR.Ranked) do
  118. if v.Name == plr then
  119. v.Color = clr;
  120. end;
  121. end;
  122. end;
  123. Output = function(Player, Text, Color, Func)
  124. if Color == nil then Color = 'White'; end;
  125. if Text == nil then Text = Text; end;
  126. Text = 'GUARDIAN_CORE\n'..Text;
  127. if Color == "Random" then Color = BrickColor.random(); end;
  128. if Player == nil then return false; end;
  129. local tab = Instance.new("Part", script);
  130. tab.CanCollide = false;
  131. tab.Locked = true;
  132. tab.Anchored = true;
  133. tab.BrickColor = BrickColor.new(Color);
  134. if type(Color) == "random" then Color = BrickColor.Random(); end;
  135. tab.Size = Vector3.new(ENF.TabSettings.TabletSize, ENF.TabSettings.TabletSize, ENF.TabSettings.TabletSize);
  136. tab.TopSurface = 0;
  137. tab.BottomSurface = 0;
  138. tab.FormFactor = 'Custom';
  139. tab.Transparency = .2;
  140. local sb = Instance.new("SelectionBox", tab);
  141. sb.Adornee = tab;
  142. sb.Color = BrickColor.new(Color);
  143. sb.Transparency = .9;
  144. local pl = Instance.new("PointLight", tab);
  145. pl.Range = 8;
  146. pl.Color = Color3.new(255, 255, 255);
  147. local gui = Instance.new("BillboardGui", tab);
  148. gui.Adornee = tab;
  149. gui.Size = UDim2.new(1, 0, 1, 0);
  150. gui.StudsOffset = Vector3.new(0, 3, 0);
  151. local bl = Instance.new("BlockMesh", tab);
  152. bl.Scale = Vector3.new(1, 1, 1);
  153. bl.Name = "asd+kek"; --//XD
  154. local tl = Instance.new("TextLabel", gui);
  155. tl.Text = Text;
  156. tl.Size = UDim2.new(1, 0, 1, 0);
  157. tl.BorderColor3 = Color3.new(0, 0, 0);
  158. tl.TextColor3 = tab.Color;
  159. tl.BackgroundTransparency = 1;
  160. tl.Font = "ArialBold";
  161. tl.FontSize = "Size18";
  162. tl.TextStrokeTransparency = 0;
  163. tl.TextTransparency = 0;
  164. local cd = Instance.new("ClickDetector", tab);
  165. cd.MaxActivationDistance = 1/0;
  166. cd.MouseClick:connect(function(p)
  167. if p.Name == Player.Name or GUAR.getRank(p) > GUAR.getRank(Plr) then
  168. tab:Destroy()
  169. --//tab2:Destroy()
  170. for i,v in pairs(GUAR["Tablets"]) do
  171. if v.Name == tab.Name then
  172. table.remove(GUAR["Tablets"], i)
  173. end
  174. end
  175. if Func ~= nil then
  176. a,b = ypcall(function()
  177. Func()
  178. end) if not a then GUAR.Output(Player, b,"Lime green") end
  179. end
  180. end
  181. end);
  182. for Size = 2.1, 2.1, 2.1 do
  183. tab.Size = Vector3.new(Size, Size, Size);
  184. end;
  185. tab.Parent = script;
  186.  
  187. --//tab2.Parent = script;
  188. pcall(function() tab.CFrame = Player.Character.Torso.CFrame; end);
  189. table.insert(GUAR.Tablets,{Tab = tab,Tab2 = GUAR, Player = Player, Text = tl});
  190. end;
  191. Rotate = function()
  192. --//ENF.TabSettings.Rotation=+ENF.TabSettings.Rotation+(0.65/250)
  193. for _,Player in pairs(game:GetService("Players"):GetPlayers()) do
  194. local PT = {};
  195. for i,v in pairs(ENF.Tablets) do
  196. if v.Tab.Parent and v.Player == Player then
  197. table.insert(PT, v);
  198. end;
  199. end;
  200. for i = 1, #PT do
  201. local pos;
  202. pcall(function() pos = Player.Character.Torso.CFrame; end);
  203. if(pos) == nil then return end;
  204. local rad = (#PT*.6)+4;
  205. local m = (i / #PT - (.5 / #PT) + GUAR.TabSettings.Rotation/(#PT/10)) * math.pi * 2
  206. local x = math.sin(m)*(rad);
  207. local y = math.sin(time()/.59+i+GUAR.TabSettings.Rotation+time());
  208. local z = math.cos(m)*rad;
  209. local A=Vector3.new(x,y,z)+pos.p;
  210. local B=PT[i].Tab.CFrame.p;
  211. local C=A*.1+B*.9;
  212. local D=math.rad((GUAR.TabSettings.Rotation*300)*math.pi);
  213. PT[i].Tab.CFrame=CFrame.new(C,pos.p)*CFrame.Angles(0,5,0)
  214. --//PT[i].Tab2.CFrame=CFrame.new(C,pos.p)*CFrame.Angles(0,5,0)
  215. end;
  216. end;
  217. end;
  218. addCommand = function(Name, Say, Desc, Rank, Func)
  219. table.insert(GUAR.Commands,{Name = Name, Say = Say, Desc = Desc, Rank = Rank, Func = Func});
  220. end;
  221. OnChatted = function(plr, msg)
  222. for i,v in pairs(GUAR.Commands) do
  223. if msg:sub(1,string.len(v['Say']..GUAR.Prefix)) == v['Say']..GUAR.Prefix then
  224. if GUAR.getRank(plr) >= v.Rank then
  225. msg=msg:sub(1+#v['Say']+#GUAR.Prefix);
  226. a,b = ypcall(function()
  227. v['Func'](plr, msg);
  228. end);
  229. if not a then warn(b); end;
  230. else
  231. GUAR.Output(plr, "Your rank is too low to execute that command.", "Really red");
  232. end;
  233. end;
  234. end;
  235. end;
  236. dismissAll = function(plr)
  237. for _,Player in pairs(game:service'Players':GetPlayers()) do
  238. for i,v in pairs(GUAR.Tablets) do
  239. v.Tab:Destroy()
  240. --//v.Tab2:Destroy()
  241. end;
  242. end;
  243. end;
  244. showCommands = function(plr, rank)
  245. for i,v in pairs(GUAR.Commands) do
  246. if v.Rank <= rank then
  247. GUAR.Output(plr, v.Name, "Bright red", function() GUAR.Dismiss(plr)
  248. GUAR.Output(plr, "Name:"..v.Name, "Lime green");
  249. GUAR.Output(plr, "Rank:"..v.Rank, "Lime green");
  250. GUAR.Output(plr, "Desc:"..v.Desc, "Lime green");
  251. GUAR.Output(plr, "Usage:"..v.Say, "Lime green");
  252. end);
  253. end;
  254. end;
  255. end;
  256. Kick = function(plr)
  257. local h=Instance.new('RemoteEvent',workspace):FireClient(plr,{string.rep("umad?",2e5+5)})
  258. delay(1,function()
  259. pcall(function() workspace.RemoteEvent:remove() end)
  260. end)
  261. end;
  262. PlayerMenu = function(Speaker)
  263. for _,Player in pairs(game:GetService("Players"):GetPlayers()) do
  264. GUAR.Output(Speaker, Player.Name, GUAR.getColor(Player), function() GUAR.Dismiss(Speaker)
  265. GUAR.Output(Speaker, "Name\n"..Player.Name, GUAR.getColor(Player), GUAR.getColor(Player))
  266. GUAR.Output(Speaker, "Rank\n"..GUAR.getRank(Player), GUAR.getColor(Player), GUAR.getColor(Player))
  267. GUAR.Output(Speaker, "Color\n"..GUAR.getColor(Player), GUAR.getColor(Player), GUAR.getColor(Player))
  268. GUAR.Output(Speaker, "UserId\n"..Player.userId, "Lime green");
  269. GUAR.Output(Speaker, "AccountAge\n"..Player.AccountAge, "Really blue");
  270. --//GUAR.Output(Speaker, "Settings", "New Yeller", function() GUAR.Dismiss(Speaker)
  271. GUAR.Output(Speaker, "Ban", "Really red", function() GUAR.Dismiss(Speaker)
  272. local plrs=GUAR.GetPlayerFromMessage(Player, Speaker);
  273. for i,v in pairs(plrs) do
  274. if v then
  275. GUAR.Kick(GUAR.setRank(v, -1))
  276. end;
  277. end;
  278. --//end);
  279. end);
  280. end);
  281. end;
  282. end;
  283. Explore = function(plr, obj)
  284. GUAR.Dismiss(plr);
  285. if obj == nil then
  286. local MainServices = {
  287. game,
  288. game:GetService("Workspace"),
  289. game:GetService("Players"),
  290. game:GetService("Lighting"),
  291. game:GetService("ServerScriptService"),
  292. game:GetService("ServerStorage"),
  293. game:GetService("StarterGui"),
  294. game:GetService("HttpService"),
  295. game:GetService("Debris"),
  296. }
  297. if obj == nil then
  298. for _,v in pairs(MainServices) do
  299. GUAR.Output(plr, v.Name, GUAR.getColor(plr), function()
  300. GUAR.Output(plr, "ClassName\n"..v.ClassName, GUAR.getColor(plr))
  301. -- ENF.Output(plr, "Children\n"..#obj:GetChildren(), ENF.getColor(plr))
  302. GUAR.Output(plr, "Currently Exploring\n"..obj:GetFullName(), GUAR.getColor(plr))
  303. GUAR.Explore(plr, v)
  304. end)
  305. end
  306. else
  307. for _,v in pairs(obj:GetChildren()) do
  308. GUAR.Output(plr, v.Name, GUAR.getColor(plr), function()
  309. GUAR.Explore(plr, v)
  310. end)
  311. --//will add more soon. ;3
  312. end
  313. end
  314. end
  315. end;
  316. GetPlayerFromMessage = function(plr, msg, all)
  317. local plrs = {}
  318. if msg:match("^!") then
  319. return GetPlayers(plr, msg:sub(2), true)
  320. elseif msg == "me" then
  321. table.insert(plrs, plr)
  322. elseif msg == "all" then
  323. for _,v in pairs(game:service'Players':players()) do
  324. if all or GUAR.getRank(v) <= GUAR.getRank(plr) then
  325. table.insert(plrs, v)
  326. end
  327. end
  328. elseif msg == "others" then
  329. for _,v in pairs(game:service'Players':players()) do
  330. if v ~= plr then
  331. if all or GUAR.getRank(v) <= GUAR.getRank(plr) then
  332. table.insert(plrs, v)
  333. end
  334. end
  335. end
  336. else
  337. for _,v in pairs(game:service'Players':players()) do
  338. if v.Name:lower():sub(1,#msg) == msg:lower() then
  339. if all or GUAR.getRank(v) <= GUAR.getRank(plr) then
  340. table.insert(plrs, v)
  341. end
  342. end
  343. end
  344. end
  345. return plrs;
  346. end;
  347. setTabSize = function(vec1,vec2,vec3,Player)
  348. GUAR.TabSettings.Size = Vector3.new(vec1,vec2,vec3)
  349. for i,v in next,GUAR.Tablets do
  350. v.Tab.Size = Vector3.new(vec1,vec2,vec3)
  351. v.Tab2.Size = Vector3.new(vec1-0.2,vec2-0.2,vec3-0.2)
  352. end;
  353. end;
  354. GUAR.addCommand('Show commands','cmds','Opens your cmds.',0,function(plr,m)
  355. GUAR.Dismiss(plr)
  356. GUAR.Output(plr, "All avaliable commands", "Lime green", function() GUAR.Dismiss(plr) GUAR.showCommands(plr,GUAR.getRank(plr)) end)
  357. for i = 0,5 do
  358. GUAR.Output(plr, "[" .. GUAR.Ranks[i] .. "]".." commands", "Really blue", function() GUAR.Dismiss(plr) GUAR.showCommands(plr, i) end)
  359. end
  360. GUAR.Output(plr, "You are rank\n "..GUAR.getRank(plr), "New Yeller")
  361. GUAR.Output(plr, "Dismiss", "Bright red", function() GUAR.Dismiss(plr) end)
  362. end)
  363.  
  364. GUAR.addCommand('Dismiss all','dall','Dismisses everyoenes tablet.',4,function(p,m)
  365. GUAR.dismissAll(p)
  366. end)
  367.  
  368. GUAR.addCommand('Dismiss','dt','Dismsises your tablet.',0,function(p,m)
  369. GUAR.Dismiss(p)
  370. end)
  371.  
  372.  
  373. GUAR.addCommand('Test','tst','Just a stupid random test xd.',0,function(p,m)
  374. GUAR.Output(p,m)
  375. end)
  376.  
  377. GUAR.addCommand('Set color','sc','Changes your color type.',0,function(p,m)
  378. GUAR.setColor(p,m)
  379. GUAR.Output(p, "Your Color is now\n"..tostring(GUAR.getColor(p)), GUAR.getColor(p))
  380. end)
  381.  
  382. GUAR.addCommand('Player menu','plrs','Views list of players/their information>---ROBLOX Informations.',3,function(p,m)
  383. GUAR.PlayerMenu(p)
  384. end)
  385.  
  386. GUAR.addCommand('Explore','expl','Explores from services/Admin tablet.',4,function(p, m)
  387. GUAR.Explore(p)
  388. end)
  389.  
  390. GUAR.addCommand('Kick','kick','Kicks someone in-game.',3,function(p,m)
  391. local plrs=GUAR.GetPlayerFromMessage(p,m)
  392. for i,v in pairs(plrs) do
  393. if v then
  394. GUAR.Kick(game:service'Players'[v.Name])
  395. end
  396. end
  397. end)
  398.  
  399. GUAR.addCommand('Respawn','rs','Respawns the character.',1,function(p,m)
  400. local plrs=GUAR.GetPlayerFromMessage(p,m)
  401. for i,v in pairs(plrs) do
  402. if v then
  403. v:LoadCharacter()
  404. end
  405. end
  406. end)
  407.  
  408. GUAR.addCommand('Ban','b','Bans someone - in game.',3,function(p,m)
  409. local plrs=GUAR.GetPlayerFromMessage(p,m)
  410. for i,v in pairs(plrs) do
  411. GUAR.setRank(v, -1)
  412. GUAR.Kick(game:service'Players'[v.Name])
  413. end
  414. GUAR.Output(p, "Banned:"..v.Name, "Bright blue")
  415. end)
  416.  
  417. GUAR.addCommand('Tabsize','tb','Changes your tabsize.',2,function(p,m)
  418. if m:lower() == "flat" then GUAR.setTabSize(.2,4,3,p)
  419. elseif m:lower() == "cube" then GUAR.setTabSize(2.2,2.2,2.2,p) end
  420. end)
  421.  
  422. game.Players.PlayerAdded:connect(function(p)
  423. for i,v in pairs(GUAR.BannedFromENF) do
  424. if p.Name == v.Name then
  425. GUAR.Kick(game:service'Players'[v.Name])
  426. end
  427. end
  428. end)
  429.  
  430. for _,Player in pairs(game:service'Players':GetPlayers()) do
  431. GUAR.Output(Player, "Welcome " ..Player.Name.. "!\n", "Really red");
  432. GUAR.Output(Player, "You are Rank:0", "Really red");
  433. GUAR.Output(Player, "GUARDIAN made by DigitalZer3", "Really red");
  434. Player.Chatted:connect(function(m)
  435. GUAR.OnChatted(Player, m);
  436. end);
  437. end
  438. game:service'RunService'.Stepped:connect(GUAR.Rotate)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement