NextYearStudios

Untitled

Mar 2nd, 2017
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 10.67 KB | None | 0 0
  1. --[[ Global Directories ]]--
  2. local StarterGui = game:GetService('StarterGui')
  3. local ServerScriptService = game:GetService('ServerScriptService')
  4. local Script_MainSetup = workspace:WaitForChild('Script_MainSetup')
  5. local Game_MainStorage = Script_MainSetup:WaitForChild('Game_MainStorage')
  6. local Game_ModuleScripts = Game_MainStorage:WaitForChild('Game_ModuleScripts')
  7. local Game_Scripts = Game_MainStorage:WaitForChild('Game_Scripts')
  8. local Game_ScriptsAssets = Game_MainStorage:WaitForChild('Game_ScriptsAssets')
  9.  
  10.  
  11. local leaderstats = game.Players.LocalPlayer:WaitForChild('leaderstats')
  12.  
  13. --[[ UI Globals ]]--
  14. local text_Color = Color3.fromRGB(62,66,76)
  15. local text_TitleTextSize = 32
  16. local text_DisplayTextSize = 25
  17. local text_IconTextSize = 25
  18. local text_TitleFont = Enum.Font.SourceSansBold
  19. local BackgroundColor1 = Color3.fromRGB(240,240,240)
  20. local BackgroundColor2 = Color3.fromRGB(255,255,255)
  21. local BackgroundColor3 = Color3.fromRGB(248,248,248)
  22.  
  23. local Shown = {}
  24. local Hidden = {}
  25. local maintainDisplaylist = {}
  26. local maintainStatlist = {}
  27.  
  28. for _,i in pairs(leaderstats:GetChildren()) do
  29.     if i.Hidden.Value then
  30.         table.insert(Hidden, i)
  31.     else
  32.         table.insert(Shown, i)
  33.     end
  34. end
  35.  
  36. function process(str)
  37.     local output = "" --result
  38.     local count = 0
  39.     str = string.reverse(str) --reverses the string so that the , go in the correct place
  40.  
  41.     for i=1 , string.len(str) do --loop through all characters
  42.         count = count + 1
  43.         if count == 4 then --uses modulo which is the remainder from the division of i/4
  44.             output = output .. "," .. string.sub(str, i, i) --adds in the , incuding the number
  45.             count = 1
  46.         else
  47.             output = output .. string.sub(str, i, i) -- no , needed
  48.         end
  49.     end
  50.     return string.reverse(output) --puts the string back to its correct format
  51. end
  52.  
  53. function maintain(item, stat)
  54.     if item.Text == (process(stat.Value)) then -- Makes sure the text is displaying the correct value
  55.         return
  56.     else
  57.         item.Text = (process(stat.Value))
  58.     end
  59.     if item.Text == "inf" then
  60.         item.Text = "Infinite"
  61.     end
  62. end
  63.  
  64.  
  65. -- creat stat ui
  66. local queue = 0
  67. local stat_Gui = game.Players.LocalPlayer.PlayerGui:FindFirstChild('UI')
  68. local stat_Frame = Instance.new('Frame', stat_Gui:FindFirstChild('Frame_HUD'))
  69. stat_Frame.Name = 'Frame_Stats'
  70. stat_Frame.Position = UDim2.new(1, -205,0, 5)
  71. stat_Frame.Size = UDim2.new(0,200,0,(36 + (60 * #Shown) + 90))
  72. stat_Frame.BackgroundTransparency = 1
  73. stat_Frame.ZIndex = 7
  74. stat_Frame.ClipsDescendants = true
  75.  
  76. local players_Frame = Instance.new('ScrollingFrame', stat_Gui:FindFirstChild('Frame_HUD'))
  77. players_Frame.Name = 'Frame_Players'
  78. --players_Frame.Position = UDim2.new(1, -205,0, 205)
  79. players_Frame.Size = UDim2.new(0,200,0,200)
  80. players_Frame.CanvasSize = UDim2.new(0,0,2,0)
  81. players_Frame.BackgroundTransparency = 1
  82. players_Frame.ZIndex = 7
  83. players_Frame.ClipsDescendants = true
  84. players_Frame.BorderSizePixel = 0
  85. players_Frame.ScrollBarThickness = 6
  86.  
  87. for i=1 ,(#Shown) do
  88.     queue = queue + 1
  89.     local Frame = Instance.new('Frame', stat_Frame)
  90.     Frame.BackgroundColor3 = BackgroundColor2
  91.     Frame.BorderSizePixel = 0
  92.     Frame.Name = ("Frame_Stat"..queue)
  93.     Frame.Size = UDim2.new(1,0,0,60)
  94.     Frame.Position = UDim2.new(0,0,0,36 + (60*(queue)- 60))
  95.     Frame.ZIndex = 8
  96.     local Shadow = Frame:Clone()
  97.     Shadow.Parent = Frame
  98.     Shadow.Name = 'Frame_Shadow'
  99.     Shadow.Style = Enum.FrameStyle.DropShadow
  100.     Shadow.Size = UDim2.new(1,6,1,6)
  101.     Shadow.Position = UDim2.new(0,-3,0,-3)
  102.     Shadow.ZIndex = 7
  103.     local Title = Instance.new('TextLabel', Frame)
  104.     Title.Name = 'Label_Name'
  105.     Title.BackgroundColor3 = BackgroundColor1
  106.     Title.BorderSizePixel = 0
  107.     Title.Size = UDim2.new(1,0,.5,0)
  108.     Title.ZIndex = 10
  109.     Title.Text = Shown[queue].Name
  110.     Title.TextSize = text_TitleTextSize
  111.     Title.Font = text_TitleFont
  112.     Title.TextColor3 = text_Color
  113.     Title.TextStrokeColor3 = Color3.new(1,1,1)
  114.     Title.TextStrokeTransparency = 1
  115.     Title.TextYAlignment = 'Bottom'
  116.     local TextShadow = Shadow:Clone()
  117.     TextShadow.Parent = Title
  118.     TextShadow.ZIndex = 9
  119.     if Shown[queue].HasIcon.Value then
  120.         local Icon = Instance.new('TextLabel', Frame)
  121.         Icon.Name = 'Label_Icon'
  122.         Icon.BackgroundColor3 = BackgroundColor2
  123.         Icon.BackgroundTransparency = 1
  124.         Icon.Position = UDim2.new(0,0,0.5,0)
  125.         Icon.BorderSizePixel = 0
  126.         Icon.Size = UDim2.new(0.125,0,.5,0)
  127.         Icon.ZIndex = 8
  128.         Icon.Text = Shown[queue].Icon.Value
  129.         Icon.TextSize = text_IconTextSize
  130.         Icon.Font = text_TitleFont
  131.         Icon.TextColor3 = text_Color
  132.         Icon.TextStrokeColor3 = Color3.new(1,1,1)
  133.         Icon.TextStrokeTransparency = 1
  134.         Icon.TextYAlignment = 'Center'
  135.         local Display = Instance.new('TextLabel', Frame)
  136.         Display.Name = 'Label_Display'
  137.         Display.BackgroundColor3 = BackgroundColor2
  138.         Display.BackgroundTransparency = 1
  139.         Display.Position = UDim2.new(0.125,0,0.5,0)
  140.         Display.BorderSizePixel = 0
  141.         Display.Size = UDim2.new(0.875,0,.5,0)
  142.         Display.ZIndex = 8
  143.         Display.TextSize = text_DisplayTextSize
  144.         Display.Font = text_TitleFont
  145.         Display.TextColor3 = text_Color
  146.         Display.TextStrokeColor3 = Color3.new(1,1,1)
  147.         Display.TextStrokeTransparency = 1
  148.         Display.TextXAlignment = 'Left'
  149.         if Shown[queue].IsCurrency.Value then
  150.             Display.Text = process(Shown[queue].Value)
  151.             maintain(Display, Shown[queue])
  152.             table.insert(maintainDisplaylist, Display)
  153.             table.insert(maintainStatlist, Shown[queue])
  154.         else
  155.             Display.Text = Shown[queue].Value
  156.         end
  157.     else
  158.         local Display = Instance.new('TextLabel', Frame)
  159.         Display.Name = 'Label_Display'
  160.         Display.BackgroundColor3 = BackgroundColor2
  161.         Display.BackgroundTransparency = 1
  162.         Display.Position = UDim2.new(0,0,0.5,0)
  163.         Display.BorderSizePixel = 0
  164.         Display.Size = UDim2.new(1,0,.5,0)
  165.         Display.ZIndex = 8
  166.         Display.TextSize = text_DisplayTextSize
  167.         Display.Font = text_TitleFont
  168.         Display.TextColor3 = text_Color
  169.         Display.TextStrokeColor3 = Color3.new(1,1,1)
  170.         Display.TextStrokeTransparency = 1
  171.         Display.TextYAlignment = 'Left'
  172.         if Shown[queue].IsCurrency.Value then
  173.             Display.Text = process(Shown[queue].Value)
  174.             maintain(Display, Shown[queue])
  175.             table.insert(maintainDisplaylist, Display)
  176.             table.insert(maintainStatlist, Shown[queue])
  177.         else
  178.             Display.Text = Shown[queue].Value
  179.         end
  180.     end
  181. end
  182.  
  183. local team_Frame = Instance.new('Frame', stat_Frame)
  184. team_Frame.BackgroundColor3 = BackgroundColor2
  185. team_Frame.BorderSizePixel = 0
  186. team_Frame.Name = ("Frame_Team")
  187. team_Frame.Size = UDim2.new(1,0,0,90)
  188. team_Frame.Position = UDim2.new(0,0,0,36 + (60*(queue)))
  189. team_Frame.ZIndex = 8
  190. local team_Shadow = team_Frame:Clone()
  191. team_Shadow.Parent = team_Frame
  192. team_Shadow.Name = 'Frame_Shadow'
  193. team_Shadow.Style = Enum.FrameStyle.DropShadow
  194. team_Shadow.Size = UDim2.new(1,6,1,6)
  195. team_Shadow.Position = UDim2.new(0,-3,0,-3)
  196. team_Shadow.ZIndex = 7
  197. local team_Title = Instance.new('TextLabel', team_Frame)
  198. team_Title.Name = 'Label_Name'
  199. team_Title.BackgroundColor3 = BackgroundColor1
  200. team_Title.BorderSizePixel = 0
  201. team_Title.Size = UDim2.new(1,0,0,30)
  202. team_Title.ZIndex = 10
  203. team_Title.Text = 'Occupation'
  204. team_Title.TextSize = text_TitleTextSize
  205. team_Title.Font = text_TitleFont
  206. team_Title.TextColor3 = text_Color
  207. team_Title.TextStrokeColor3 = Color3.new(1,1,1)
  208. team_Title.TextStrokeTransparency = 1
  209. team_Title.TextYAlignment = 'Bottom'
  210. local team_TitleShadow = team_Shadow:Clone()
  211. team_TitleShadow.Parent = team_Title
  212. team_TitleShadow.Name = 'Frame_Shadow'
  213. team_TitleShadow.Style = Enum.FrameStyle.DropShadow
  214. team_TitleShadow.Size = UDim2.new(1,6,1,6)
  215. team_TitleShadow.Position = UDim2.new(0,-3,0,-3)
  216. team_TitleShadow.ZIndex = 8
  217. local team_Display = Instance.new('TextLabel', team_Frame)
  218. team_Display.Name = 'Label_Display'
  219. team_Display.BackgroundColor3 = BackgroundColor2
  220. team_Display.BackgroundTransparency = 1
  221. team_Display.Position = UDim2.new(0,0,0,30)
  222. team_Display.BorderSizePixel = 0
  223. team_Display.Size = UDim2.new(1,0,0,30)
  224. team_Display.ZIndex = 8
  225. team_Display.TextSize = text_DisplayTextSize
  226. team_Display.Font = text_TitleFont
  227. team_Display.TextColor3 = text_Color
  228. team_Display.TextStrokeColor3 = Color3.new(1,1,1)
  229. team_Display.TextStrokeTransparency = 1
  230. team_Display.TextXAlignment = 'Center'
  231. team_Display.Text = game.Players.LocalPlayer.Team.Name
  232. local team_Display2 = Instance.new('TextLabel', team_Frame)
  233. team_Display2.Name = 'Label_Display2'
  234. team_Display2.BackgroundColor3 = BackgroundColor3
  235. team_Display2.BackgroundTransparency = 0
  236. team_Display2.Position = UDim2.new(0,0,0,60)
  237. team_Display2.BorderSizePixel = 0
  238. team_Display2.Size = UDim2.new(1,0,0,30)
  239. team_Display2.ZIndex = 8
  240. team_Display2.TextSize = text_DisplayTextSize
  241. team_Display2.Font = text_TitleFont
  242. team_Display2.TextColor3 = text_Color
  243. team_Display2.TextStrokeColor3 = Color3.new(1,1,1)
  244. team_Display2.TextStrokeTransparency = 1
  245. team_Display2.TextXAlignment = 'Center'
  246. team_Display2.Text = ("$"..(game.Players.LocalPlayer.Team.Folder_TeamStats.PayRate.Value) .. " / Hr")
  247.  
  248. local leaderstats = game.Players.LocalPlayer:WaitForChild('leaderstats')
  249.    
  250. if leaderstats.TopBarEnabled.Value == false then   
  251.     spawn(function ()
  252.         while not pcall(StarterGui.SetCore,StarterGui,"TopbarEnabled",false) do
  253.         wait()
  254.         end
  255.     end)
  256. end
  257. local queue = 0
  258.  
  259. game.Players.PlayerAdded:connect(function(player)
  260.     local playerlabel = {}
  261.     print(player.Name)
  262.     for _,i in pairs(players_Frame:GetChildren()) do
  263.         queue = queue + 1
  264.         if i.Text == player.Name then
  265.             table.insert(playerlabel, i)
  266.         else
  267.             return
  268.         end
  269.         if #playerlabel == 0 then
  270.             local player_name = Instance.new('TextLabel', players_Frame)
  271.             player_name.Text = player.Name
  272.             player_name.BackgroundColor3 = Color3.fromRGB(255,255,255)
  273.             player_name.BackgroundTransparency = .5
  274.             player_name.BorderSizePixel = 0
  275.             player_name.Size = UDim2.new(1,0,0,30)
  276.             player_name.Font = Enum.Font.SourceSansBold
  277.             player_name.TextSize = '25'
  278.             player_name.TextColor3 = text_Color
  279.             player_name.Name = 'Player'..(queue)
  280.             player_name.Position = UDim2.new(0,0,0, 30*queue-30)
  281.             player_name.ClipsDescendants = true
  282.             players_Frame.CanvasSize = UDim2.new(0,0,2,(30*queue))
  283.             players_Frame.Position = UDim2.new(1,-205,0, 196)
  284.         else
  285.             return
  286.         end
  287.     end
  288. end)
  289.  
  290. game.Players.PlayerRemoving:connect(function(player)
  291.     for _,i in pairs(players_Frame:GetChildren()) do
  292.         if i.Text == player.Name then
  293.             i:Destroy()
  294.             queue = queue - 1
  295.         end
  296.     end
  297. end)
  298.  
  299. while true do
  300.     wait()
  301.     maintain(maintainDisplaylist[1], maintainStatlist[1])
  302.     game.Players.LocalPlayer.PlayerGui:WaitForChild('UI').Frame_HUD:WaitForChild('Frame_Stats').Frame_Team.Label_Display2.Text = ("$"..(game.Players.LocalPlayer.Team.Folder_TeamStats.PayRate.Value) .. " / Hr")
  303.     game.Players.LocalPlayer.PlayerGui:WaitForChild('UI').Frame_HUD:WaitForChild('Frame_Stats').Frame_Team.Label_Display.Text = game.Players.LocalPlayer.Team.Name
  304. end
  305. print('Shown: '..#Shown..' Hidden: '..#Hidden)
Advertisement
Add Comment
Please, Sign In to add comment