Advertisement
iiFlamez

Untitled

Dec 13th, 2017
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.52 KB | None | 0 0
  1. -- params : ...
  2.  
  3. wait(1)
  4. Players = game:GetService("Players")
  5. Player = Players.LocalPlayer
  6. Replicated = game:GetService("ReplicatedStorage")
  7. Func = Replicated:WaitForChild("GMFunc")
  8. Event = Replicated:WaitForChild("GMEvent")
  9. Gui = script.Parent
  10. TabList = Gui.TabList
  11. Windows = Gui.Windows
  12. AlertPrompt = Gui.AlertPrompt
  13. BackgroundNormal = Color3.new(0.49803921568627, 0.74509803921569, 0.74509803921569)
  14. BackgroundSelected = Color3.new(1, 0.66666666666667, 0)
  15. PromptButtonBackgroundNormal = Color3.new(0.33725490196078, 0.50588235294118, 0.50588235294118)
  16. PromptButtonBackgroundSelected = BackgroundSelected
  17. Selected = {}
  18. MouseEnterEvents = {}
  19. MouseLeaveEvents = {}
  20. for _,v in pairs(Gui:children()) do
  21. do
  22. if v:IsA("Sound") then
  23. do
  24. game:service("ContentProvider"):Preload(v.SoundId)
  25. -- DECOMPILER ERROR at PC85: LeaveBlock: unexpected jumping out IF_THEN_STMT
  26.  
  27. -- DECOMPILER ERROR at PC85: LeaveBlock: unexpected jumping out IF_STMT
  28.  
  29. end
  30. end
  31. end
  32. end
  33. ShowAlertPrompt = function(Title, Body, NoText, YesText, NoFunc, YesFunc)
  34. local Window = AlertPrompt.Window
  35. Window.Top.Title.Text = Title
  36. Window.Body.Text = Body
  37. Window.No.TextLabel.Text = NoText
  38. Window.Yes.TextLabel.Text = YesText
  39. if not MouseEnterEvents[Window.No] then
  40. MouseEnterEvents[Window.No] = Window.No.MouseEnter:connect(function()
  41. Window.No.BackgroundColor3 = PromptButtonBackgroundSelected
  42. Window.No.ImageColor3 = PromptButtonBackgroundSelected
  43. end)
  44. end
  45. if not MouseLeaveEvents[Window.No] then
  46. MouseLeaveEvents[Window.No] = Window.No.MouseLeave:connect(function()
  47. Window.No.BackgroundColor3 = PromptButtonBackgroundNormal
  48. Window.No.ImageColor3 = PromptButtonBackgroundNormal
  49. end)
  50. end
  51. if not MouseEnterEvents[Window.Yes] then
  52. MouseEnterEvents[Window.Yes] = Window.Yes.MouseEnter:connect(function()
  53. Window.Yes.BackgroundColor3 = PromptButtonBackgroundSelected
  54. Window.Yes.ImageColor3 = PromptButtonBackgroundSelected
  55. end)
  56. end
  57. if not MouseLeaveEvents[Window.Yes] then
  58. MouseLeaveEvents[Window.Yes] = Window.Yes.MouseLeave:connect(function()
  59. Window.Yes.BackgroundColor3 = PromptButtonBackgroundNormal
  60. Window.Yes.ImageColor3 = PromptButtonBackgroundNormal
  61. end)
  62. end
  63. Window.No.MouseButton1Click:connect(function()
  64. NoFunc()
  65. end)
  66. Window.Yes.MouseButton1Click:connect(function()
  67. YesFunc()
  68. end)
  69. Gui.Alert:Play()
  70. AlertPrompt.Visible = true
  71. end
  72.  
  73. ClosePrompt = function(Base)
  74. local Window = Base.Window
  75. Base.Visible = false
  76. Window.No.BackgroundColor3 = PromptButtonBackgroundNormal
  77. Window.No.ImageColor3 = PromptButtonBackgroundNormal
  78. Window.Yes.BackgroundColor3 = PromptButtonBackgroundNormal
  79. Window.Yes.ImageColor3 = PromptButtonBackgroundNormal
  80. end
  81.  
  82. for _,v in pairs(TabList:children()) do
  83. do
  84. Selected[v] = false
  85. v.MouseEnter:connect(function()
  86. v.BackgroundColor3 = BackgroundSelected
  87. v.ImageColor3 = BackgroundSelected
  88. end)
  89. v.MouseLeave:connect(function()
  90. if not Selected[v] then
  91. v.BackgroundColor3 = BackgroundNormal
  92. v.ImageColor3 = BackgroundNormal
  93. end
  94. end)
  95. v.MouseButton1Click:connect(function()
  96. Selected[v] = not Selected[v]
  97. Gui.Beep:Play()
  98. for _,x in pairs(TabList:children()) do
  99. if x.Name ~= v.Name then
  100. Selected[x] = false
  101. x.BackgroundColor3 = BackgroundNormal
  102. x.ImageColor3 = BackgroundNormal
  103. end
  104. end
  105. for _,x in pairs(Gui:children()) do
  106. if x:IsA("ScrollingFrame") and x ~= TabList and x.Name:find("TabList") and x.Name ~= "TabList" .. v.Name then
  107. x.Visible = false
  108. end
  109. end
  110. local Next = Gui["TabList" .. v.Name]
  111. Next.Visible = Selected[v]
  112. end)
  113. end
  114. end
  115. for _,h in pairs(Gui:children()) do
  116. if h:IsA("ScrollingFrame) and h ~= TabList and h.Name:find("TabList) then
  117. for _,v in pairs(h:children()) do
  118. if v.ClassName:find("Button") then
  119. Selected[v] = false
  120. v.MouseEnter:connect(function()
  121. v.BackgroundColor3 = BackgroundSelected
  122. v.ImageColor3 = BackgroundSelected
  123. end)
  124. v.MouseLeave:connect(function()
  125. if not Selected[v] then
  126. v.BackgroundColor3 = BackgroundNormal
  127. v.ImageColor3 = BackgroundNormal
  128. end
  129. end)
  130. v.MouseButton1Click:connect(function()
  131. Selected[v] = not Selected[v]
  132. for _,x in pairs(h:children()) do
  133. if x.Name ~= v.Name then
  134. Selected[x] = false
  135. x.BackgroundColor3 = BackgroundNormal
  136. x.ImageColor3 = BackgroundNormal
  137. end
  138. end
  139. if v.Name == "Logout" then
  140. ShowAlertPrompt("LOG OUT", "Logging out will terminate all services.", "Cancel", "Log Out", function()
  141. Gui.PromptClose:Play()
  142. ClosePrompt(AlertPrompt)
  143. Selected[v] = false
  144. v.BackgroundColor3 = BackgroundNormal
  145. v.ImageColor3 = BackgroundNormal
  146. end, function()
  147. Gui.PromptAccept:Play()
  148. Player:Kick("Cardinal // You have been logged out of Aincrad Online.")
  149. end)
  150. else
  151. if v.Name == "PlayerData" then
  152. Gui.Beep:Play()
  153. Windows.PlayerData.Visible = not Windows.PlayerData.Visible
  154. else
  155. if v.Name == "DataSpread" then
  156. Gui.Beep:Play()
  157. Windows.DataSpread.Visible = not Windows.DataSpread.Visible
  158. else
  159. Gui.Beep:Play()
  160. end
  161. end
  162. end
  163. end)
  164. end
  165. end
  166. end
  167. end
  168. local Window = Windows.PlayerData
  169. local Prompt = Window.Prompt
  170. local PromptWindow = Prompt.Window
  171. local Scroll = Window.DataScroll
  172. local PlayerName = Window.PlayerName
  173. local Close = PromptWindow.Top.Close
  174. Close.MouseButton1Click:connect(function()
  175. Gui.PromptClose:Play()
  176. Prompt.Visible = false
  177. end)
  178. local TextBox = PromptWindow.Input.TextBox
  179. TextBox.FocusLost:connect(function(Enter)
  180. if Enter then
  181. local Data = Func:InvokeServer("GetPlayerData", TextBox.Text)
  182. if not Data then
  183. Gui.Fail:Play()
  184. return
  185. end
  186. Gui.PromptAccept:Play()
  187. Prompt.Visible = false
  188. PlayerName.Text = TextBox.Text:upper()
  189. for _,v in pairs(Scroll:children()) do
  190. if v.Name ~= "Example" then
  191. v:Remove()
  192. end
  193. end
  194. local Index = 0
  195. for i,v in pairs(Data) do
  196. Index = Index + 1
  197. local Val = tostring(v)
  198. local New = Scroll.Example:Clone()
  199. New.Visible = true
  200. New.Name = Index
  201. New.Left.Text = i
  202. New.Right.Text = #Val > 30 and Val:sub(1, 27) .. "..." or Val
  203. New.Position = UDim2.new(0, 0, 0, Scroll.Example.Size.Y.Offset * (Index - 1))
  204. New.Parent = Scroll
  205. end
  206. Scroll.CanvasSize = UDim2.new(0, 0, 0, (Index) * Scroll.Example.Size.Y.Offset)
  207. end
  208. end)
  209. local Search = Window.Search
  210. Search.MouseEnter:connect(function()
  211. Search.Image = "rbxassetid://299627353"
  212. end)
  213. Search.MouseLeave:connect(function()
  214. Search.Image = "rbxassetid://299627334"
  215. end)
  216. Search.MouseButton1Click:connect(function()
  217. Prompt.Visible = true
  218. end)
  219. local Window = Windows.DataSpread
  220. local LevelGraph = Window.LevelGraph
  221. local ColGraph = Window.ColGraph
  222. local RefreshDeb = false
  223. UpdateSpreadGraphs = function(nosound)
  224. local Data = Func:InvokeServer("GetDataSpread")
  225. if not Data and not nosound then
  226. Gui.Fail:Play()
  227. end
  228. do return end
  229. if not nosound then
  230. Gui.PromptAccept:Play()
  231. end
  232. local TotalPlayers = 0
  233. local HighestLevel, HighestCol = 0, 0
  234. for _,v in pairs(Data) do
  235. local userId = v.key:match("%d+")
  236. local data = v.value
  237. if data then
  238. TotalPlayers = TotalPlayers + 1
  239. for _,sub in pairs(data) do
  240. local name = sub[1]
  241. local val = sub[2]
  242. if name == "Level" and HighestLevel == 0 then
  243. HighestLevel = val
  244. else
  245. if name == "Col" and HighestCol < val then
  246. HighestCol = val
  247. end
  248. end
  249. end
  250. end
  251. end
  252. local IncLevel = math.floor(HighestLevel / 6)
  253. local IncCol = math.floor(HighestCol / 6)
  254. local Prev1 = 0
  255. local Current1 = IncLevel
  256. local Prev2 = 0
  257. local Current2 = IncCol
  258. local Ranges1, Ranges2 = {}, {}
  259. for i = 1, 6 do
  260. local Frame1 = LevelGraph["Frame" .. i]
  261. local Frame2 = ColGraph["Frame" .. i]
  262. Frame1.Label.Text = Prev1 .. " - " .. Current1
  263. Frame2.Label.Text = Prev2 .. " - " .. Current2
  264. Ranges1[i] = {Prev1, Current1, 0}
  265. Ranges2[i] = {Prev2, Current2, 0}
  266. Prev1 = Prev1 + IncLevel + 1
  267. Current1 = Prev1 + IncLevel
  268. Prev2 = Prev2 + IncCol + 1
  269. Current2 = Prev2 + IncCol
  270. if i == 5 then
  271. Current1 = HighestLevel
  272. Current2 = HighestCol
  273. end
  274. end
  275. for _,v in pairs(Data) do
  276. local userId = v.key:match("%d+")
  277. local data = v.value
  278. if data then
  279. for _,sub in pairs(data) do
  280. local name = sub[1]
  281. local val = sub[2]
  282. local graph, ranges = nil, nil
  283. if name == "Level" then
  284. graph = Window.LevelGraph
  285. ranges = Ranges1
  286. else
  287. if name == "Col" then
  288. graph = Window.ColGraph
  289. ranges = Ranges2
  290. end
  291. end
  292. if graph and ranges then
  293. for num,range in pairs(ranges) do
  294. local min = range[1]
  295. local max = range[2]
  296. local total = range[3]
  297. if min <= val and val <= max then
  298. ranges[num] = {min, max, total + 1}
  299. break
  300. end
  301. end
  302. end
  303. end
  304. end
  305. end
  306. for num,range in pairs(Ranges1) do
  307. local min = range[1]
  308. local max = range[2]
  309. local total = range[3]
  310. LevelGraph["Frame" .. num].Bar:TweenSize((UDim2.new(math.max(total / (TotalPlayers) - 0.1, 0), 0, 1, 0)), nil, nil, 0.2, true)
  311. if total ~= 0 or not "" then
  312. do
  313. LevelGraph["Frame" .. num].Bar.Percent.Text = "~" .. math.floor(total / (TotalPlayers) * 100) .. "%"
  314. -- DECOMPILER ERROR at PC226: LeaveBlock: unexpected jumping out IF_THEN_STMT
  315.  
  316. -- DECOMPILER ERROR at PC226: LeaveBlock: unexpected jumping out IF_STMT
  317.  
  318. end
  319. end
  320. end
  321. for num,range in pairs(Ranges2) do
  322. local min = range[1]
  323. local max = range[2]
  324. local total = range[3]
  325. ColGraph["Frame" .. num].Bar:TweenSize((UDim2.new(math.max(total / (TotalPlayers) - 0.1, 0), 0, 1, 0)), nil, nil, 0.2, true)
  326. if total ~= 0 or not "" then
  327. do
  328. ColGraph["Frame" .. num].Bar.Percent.Text = "~" .. math.floor(total / (TotalPlayers) * 100) .. "%"
  329. -- DECOMPILER ERROR at PC279: LeaveBlock: unexpected jumping out IF_THEN_STMT
  330.  
  331. -- DECOMPILER ERROR at PC279: LeaveBlock: unexpected jumping out IF_STMT
  332.  
  333. end
  334. end
  335. end
  336. Window.Total.Text = TotalPlayers .. " players graphed"
  337. end
  338.  
  339. Window.Refresh.MouseButton1Click:connect(function()
  340. if RefreshDeb then
  341. return
  342. end
  343. RefreshDeb = true
  344. Window.Total.Text = "Loading data..."
  345. for _,v in pairs(Window:children()) do
  346. if v.Name:find("Graph") and v:IsA("Frame") then
  347. for x = 1, 6 do
  348. v["Frame" .. x].Bar.Percent.Text = ""
  349. v["Frame" .. x].Bar:TweenSize((UDim2.new(0, 0, 1, 0)), nil, nil, 0.2, true)
  350. end
  351. end
  352. end
  353. UpdateSpreadGraphs()
  354. wait(3)
  355. RefreshDeb = false
  356. end)
  357. Window.ViewLevelGraph.MouseButton1Click:connect(function()
  358. do
  359. local View = "LevelGraph"
  360. for _,v in pairs(Window:children()) do
  361. if v.Name ~= View then
  362. do
  363. v.Visible = not v.Name:find("Graph") or not v:IsA("Frame")
  364. -- DECOMPILER ERROR at PC24: LeaveBlock: unexpected jumping out IF_THEN_STMT
  365.  
  366. -- DECOMPILER ERROR at PC24: LeaveBlock: unexpected jumping out IF_STMT
  367.  
  368. end
  369. end
  370. end
  371. Gui.PromptAccept:Play()
  372. -- DECOMPILER ERROR: 2 unprocessed JMP targets
  373. end
  374. end)
  375. Window.ViewColGraph.MouseButton1Click:connect(function()
  376. do
  377. local View = "ColGraph"
  378. for _,v in pairs(Window:children()) do
  379. if v.Name ~= View then
  380. do
  381. v.Visible = not v.Name:find("Graph") or not v:IsA("Frame")
  382. -- DECOMPILER ERROR at PC24: LeaveBlock: unexpected jumping out IF_THEN_STMT
  383.  
  384. -- DECOMPILER ERROR at PC24: LeaveBlock: unexpected jumping out IF_STMT
  385.  
  386. end
  387. end
  388. end
  389. Gui.PromptAccept:Play()
  390. -- DECOMPILER ERROR: 2 unprocessed JMP targets
  391. end
  392. end)
  393. UpdateSpreadGraphs(true)
  394. Event.OnClientEvent:connect(function(...)
  395. local Args = {...}
  396. if Args[1] == "UpdateSpreadGraphs" then
  397. UpdateSpreadGraphs(true)
  398. end
  399. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement