Advertisement
xCharliex

Glade [TABS]

Oct 21st, 2017
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.17 KB | None | 0 0
  1. local IDPT1 = math.random(1111, 9999)
  2. local IDPT2 = math.random(1111, 9999)
  3. local IDPT3 = math.random(1111, 9999)
  4. local ID = IDPT1 + IDPT2 + IDPT3
  5.  
  6. local MS = game:GetService("MarketplaceService")
  7.  
  8. local rankIDs = {
  9.     R1 = 1169257649,
  10.     R2 = 1169259363,
  11.     R3 = 1169260841,
  12.     R4 = 1169268622,
  13.     R5 = 1169273209
  14. }
  15.  
  16. local cmds = {
  17.     {
  18.         Rank = 1,
  19.         Command = "btools",
  20.         Execute = function() print("btools!") end
  21.     }
  22. }
  23.  
  24. local bindableFunc = Instance.new("BindableFunction", game.ReplicatedStorage)
  25.  
  26. function dphr(rank, plr)
  27.     return true
  28. end
  29.  
  30. function Cmd(cmd, plr)
  31.     for i,v in pairs(cmds) do
  32.         if v.Command == cmd then
  33.             if dphr(v.Rank, plr) then
  34.                 v.Execute()
  35. return true
  36.             else
  37.                 MS:PromptPurchase(rankIDs.R..v.Rank, plr)
  38.             end
  39.         end
  40.     end
  41. print("Command not found: "..cmd)
  42. end
  43.  
  44. function isR6(char)
  45.     if char:FindFirstChild("Torso") then
  46.         return true
  47.     else
  48.         return false
  49.     end
  50. end
  51.  
  52. function createTab(args)
  53.     local Main = Instance.new("Model", args.Store)
  54.     local Tab = Instance.new("Model", Main)
  55.     Tab.Name = "[Glade Tabs] "..args.Text
  56.     local Block = Instance.new("Part", Tab)
  57.     Block.Anchored = true
  58.     Block.Name = "Head"
  59.     Block.BrickColor = args.Color
  60.     Block.TopSurface = "1"
  61.     Block.BottomSurface = "1"
  62.     if isR6(args.Store) then
  63.         local ps = args.Store.Torso.Position
  64.         local Vec = Vector3.new(ps.X, ps.Y, ps.Z)
  65.         Block.Position = Vec
  66.     else
  67.         local ps = args.Store.UpperTorso.Position
  68.         local Vec = Vector3.new(ps.X, ps.Y, ps.Z)
  69.         Block.Position = Vec
  70.     end
  71.     local Human = Instance.new("Humanoid", Tab)
  72.     Human.Name = "DisplayFeature"
  73.     local Click = Instance.new("ClickDetector", Block)
  74.     Click.Name = "Click"
  75.     Click.MaxActivationDistance = 9999999
  76.     Click.MouseClick:connect(function(plr)
  77.     print("Clicked")
  78.     Main:Destroy()
  79.     end)
  80.     if args.Border ~= nil then
  81.         local border = Instance.new("SelectionBox", Tab)
  82.         border.Adornee = Block
  83.         border.Color3 = args.Border.Color
  84.     end
  85. end
  86.  
  87. function scanplrs()
  88.     for i,v in pairs(game.Players:GetChildren()) do
  89.         if v:FindFirstChild("GladeTabs") ~= true then
  90.             local gt = Instance.new("Folder", v)
  91.             gt.Name = "GladeTabs"..ID
  92.         end
  93.     end
  94. end
  95.  
  96. game.Players.PlayerAdded:connect(function(player)
  97.     print(player.Name.." joined")
  98.     scanplrs()
  99.     player.Chatted:connect(function(msg)
  100.         if string.sub(msg, 1, 3) == "gl/" then
  101.             Cmd(string.sub(msg, 4), v)
  102.         elseif string.sub(msg, 1, 6) == "/e gl/" then
  103.             Cmd(string.sub(msg, 7), v)
  104.         end
  105.     end)
  106.     for i,v in pairs(game.Players:GetChildren()) do
  107.         if v.Name ~= player.Name then
  108.             createTab({
  109.                 Text = player.Name.." joined the game";
  110.                 Store = v.Character;
  111.                 Color = BrickColor.new(255, 255, 255);
  112.                 Callback = "Destroy";
  113.                 Border = {
  114.                     Color = Color3.new(0, 255, 0);
  115.                 };
  116.                 Owner = v.Name
  117.             })
  118.         end
  119.     end
  120. end)
  121.  
  122. game.Players.PlayerRemoving:connect(function(player)
  123.     print(player.Name.." left")
  124.     scanplrs()
  125.     for i,v in pairs(game.Players:GetChildren()) do
  126.         if v.Name ~= player.Name then
  127.             createTab({
  128.                 Text = player.Name.." left the game";
  129.                 Store = v.Character;
  130.                 Color = BrickColor.new(255, 255, 255);
  131.                 Callback = "Destroy";
  132.                 Border = {
  133.                     Color = Color3.new(255, 0, 0);
  134.                 };
  135.                 Owner = v.Name
  136.             })
  137.         end
  138.     end
  139. end)
  140.  
  141. scanplrs()
  142.  
  143. for i,v in pairs(game.Players:GetChildren()) do
  144.     v.Chatted:connect(function(msg)
  145.         if string.sub(msg, 1, 3) == "gl/" then
  146.             print("Command execution")
  147.             Cmd(string.sub(msg, 4), v)
  148.         elseif string.sub(msg, 1, 6) == "/e gl/" then
  149.             print("Command execution")
  150.             Cmd(string.sub(msg, 7), v)
  151.         end
  152.     end)
  153. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement