Advertisement
Reversal00

Untitled

May 21st, 2018
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 66.45 KB | None | 0 0
  1. -- Location: game.StarterPlayer.StarterPlayerScripts.Handle_Client
  2. -- Synapse Decompiler
  3. -- Purchase Here: https://brack4712.xyz/synapse/purchase/
  4.  
  5. local Player = game.Players.LocalPlayer
  6. local Camera = game.Workspace.CurrentCamera
  7. local coreUI = script.Parent:WaitForChild("Core_UI")
  8. coreUI.Parent = Player:WaitForChild("PlayerGui")
  9. local modules = script.Parent:WaitForChild("Modules")
  10. local buttonModule = require(modules.Button_Manager)
  11. local matching = coreUI.Lobby.Matching
  12. local startMatching = matching.Play
  13. local toggleFill = matching.FillButton
  14. local toggleType = matching.TypeButton
  15. local remoteEvents = game.ReplicatedStorage.Remote_Events
  16. local remoteFunctions = game.ReplicatedStorage.Remote_Functions
  17. local playerData = game.ReplicatedStorage.Player_Data:WaitForChild(Player.Name)
  18. local marketplaceService = game:GetService("MarketplaceService")
  19. local onlineFriends = 0
  20. local tock = tick()
  21. local dotCount = 0
  22. local currentlyPlaying, currentlyPlayingButton
  23. local types = {
  24. "Solo",
  25. "Duo",
  26. "Squad"
  27. }
  28. local friendsOpen = false
  29. local friendsRefresh = tick() - 2
  30. local friends
  31. local counter = 5
  32. local lastFriendCount = 0
  33. local callingMatching = false
  34. local callingToggleFill = false
  35. local callingToggleType = false
  36. local togglingInvite = false
  37. local leavingGroup = false
  38. local pages = {
  39. coreUI.Lobby,
  40. coreUI.Locker,
  41. coreUI.ItemShop,
  42. coreUI.Stats,
  43. coreUI.Leaderboard,
  44. coreUI.Store,
  45. coreUI.Codes,
  46. coreUI.Inventory,
  47. coreUI.Possibles,
  48. coreUI.Edit,
  49. coreUI.News,
  50. coreUI.Keybinds
  51. }
  52. local selectedPage = 1
  53. local requestQue = {}
  54. local invitePlayer
  55. local canUseCode = true
  56. local storeSwapped = false
  57. local lastLeaderboardGet = 0
  58. local currentLeaderboardType = 1
  59. local soloDeathsX, soloWinsX, soloKillsX, duoDeathsX, duoWinsX, duoKillsX, squadDeathsX, squadWinsX, squadKillsX = {}, {}, {}, {}, {}, {}, {}, {}, {}
  60. local tpDataTick = tick()
  61. local tpService = game:GetService("TeleportService")
  62. local leaderboardSecondUpdate = 0
  63. local exclusiveOpen = false
  64. local doingBuyChest = false
  65. local doingEquip = false
  66. local doingBuy = false
  67. local doingEdit = false
  68. local rewardOpen = false
  69. local purchasedEdits = false
  70. local beforeEdit = {}
  71. local creditTiers = {
  72. 1000,
  73. 5000,
  74. 26000,
  75. 56000,
  76. 119000
  77. }
  78. local tierIds = {
  79. 136082859,
  80. 136158395,
  81. 136158425,
  82. 136158463,
  83. 136158507
  84. }
  85. local levelData = {
  86. Color3.new(0.5450980392156862, 0.5686274509803921, 0.6470588235294118),
  87. Color3.new(0.13333333333333333, 0.7725490196078432, 0.09803921568627451),
  88. Color3.new(0.07450980392156863, 0.596078431372549, 0.8196078431372549),
  89. Color3.new(0.5725490196078431, 0.13333333333333333, 0.8274509803921568),
  90. Color3.new(0.8156862745098039, 0.5333333333333333, 0.20784313725490197),
  91. Color3.new(0.9215686274509803, 0.8156862745098039, 0.3843137254901961)
  92. }
  93. local playerObj = script.LocalPlayer
  94. playerObj.Name = Player.Name
  95. playerObj:WaitForChild("Head").Info.Username.Text = Player.Name
  96. playerObj.Parent = workspace.Characters
  97. local Character = playerObj
  98. local Humanoid = Character:WaitForChild("Humanoid")
  99. local UIS = game:GetService("UserInputService")
  100. UIS.ModalEnabled = true
  101. game.Workspace:WaitForChild("Cam_Point").Transparency = 1
  102. Camera.CameraType = Enum.CameraType.Scriptable
  103. Camera.CFrame = game.Workspace.Cam_Point.CFrame
  104. local commaSeperate = function(Value)
  105. local commadString = ""
  106. local String = tostring(Value)
  107. local currentInt = 0
  108. for i = 1, string.len(String) do
  109. if currentInt < 3 then
  110. commadString = string.sub(String, string.len(String), string.len(String)) .. commadString
  111. String = string.sub(String, 1, string.len(String) - 1)
  112. else
  113. currentInt = 0
  114. commadString = "," .. commadString
  115. commadString = string.sub(String, string.len(String), string.len(String)) .. commadString
  116. String = string.sub(String, 1, string.len(String) - 1)
  117. end
  118. currentInt = currentInt + 1
  119. end
  120. return commadString
  121. end
  122. local function toggleExclusive(override, trueOverride)
  123. if not override then
  124. exclusiveOpen = not exclusiveOpen
  125. else
  126. exclusiveOpen = trueOverride
  127. end
  128. if exclusiveOpen then
  129. coreUI.Exclusive.Visible = true
  130. coreUI.Exclusive:TweenPosition(UDim2.new(0, 0, 0, 0), "Out", "Quart", 0.25, true)
  131. else
  132. coreUI.Exclusive:TweenPosition(UDim2.new(-1, 0, 0, 0), "Out", "Quart", 0.25, true)
  133. wait(0.255)
  134. if coreUI.Exclusive.Position == UDim2.new(-1, 0, 0, 0) then
  135. coreUI.Exclusive.Visible = false
  136. end
  137. end
  138. end
  139. local buyingExclusive = false
  140. local function purchaseExclusive()
  141. if not playerData.Exclusive_Purchased.Value then
  142. buyingExclusive = true
  143. marketplaceService:PromptProductPurchase(Player, 237087206)
  144. wait(2)
  145. buyingExclusive = false
  146. end
  147. end
  148. local function toggleReward(val)
  149. if val then
  150. coreUI.Reward.Visible = true
  151. coreUI.Reward:TweenPosition(UDim2.new(0, 0, 0, 0), "Out", "Quart", 0.25, true)
  152. else
  153. coreUI.Reward:TweenPosition(UDim2.new(-1, 0, 0, 0), "Out", "Quart", 0.25, true)
  154. wait(0.255)
  155. if coreUI.Reward.Position == UDim2.new(-1, 0, 0, 0) then
  156. coreUI.Reward.Visible = false
  157. end
  158. end
  159. end
  160. local keybindValues = {
  161. [0] = "?",
  162. [8] = "Bck",
  163. [9] = "Tab",
  164. [12] = "Clr",
  165. [13] = "Rtn",
  166. [19] = "Pse",
  167. [27] = "Esc",
  168. [32] = "Space",
  169. [35] = "#",
  170. [36] = "$",
  171. [37] = "%",
  172. [38] = "&",
  173. [39] = "\"",
  174. [40] = "(",
  175. [41] = ")",
  176. [42] = "*",
  177. [43] = "+",
  178. [44] = ",",
  179. [45] = "-",
  180. [46] = ".",
  181. [47] = "/",
  182. [48] = "0",
  183. [49] = "1",
  184. [50] = "2",
  185. [51] = "3",
  186. [52] = "4",
  187. [53] = "5",
  188. [54] = "6",
  189. [55] = "7",
  190. [56] = "8",
  191. [57] = "9",
  192. [58] = ":",
  193. [59] = ";",
  194. [60] = "<",
  195. [61] = "=",
  196. [62] = ">",
  197. [63] = "?",
  198. [64] = "@",
  199. [91] = "[",
  200. [93] = "]",
  201. [94] = "^",
  202. [95] = "_",
  203. [96] = "`",
  204. [97] = "A",
  205. [98] = "B",
  206. [99] = "C",
  207. [100] = "D",
  208. [101] = "E",
  209. [102] = "F",
  210. [103] = "G",
  211. [104] = "H",
  212. [105] = "I",
  213. [106] = "J",
  214. [107] = "K",
  215. [108] = "L",
  216. [109] = "M",
  217. [110] = "N",
  218. [111] = "O",
  219. [112] = "P",
  220. [113] = "Q",
  221. [114] = "R",
  222. [115] = "S",
  223. [116] = "T",
  224. [117] = "U",
  225. [118] = "V",
  226. [119] = "W",
  227. [120] = "X",
  228. [121] = "Y",
  229. [122] = "Z",
  230. [123] = "{",
  231. [124] = "|",
  232. [125] = "}",
  233. [126] = "~",
  234. [127] = "Del",
  235. [256] = "K0",
  236. [257] = "K1",
  237. [258] = "K2",
  238. [259] = "K3",
  239. [260] = "K4",
  240. [261] = "K5",
  241. [262] = "K6",
  242. [263] = "K7",
  243. [264] = "K8",
  244. [265] = "K9",
  245. [266] = "K.",
  246. [267] = "K/",
  247. [268] = "K*",
  248. [269] = "K-",
  249. [270] = "K+",
  250. [271] = "KRt",
  251. [272] = "K=",
  252. [273] = "Up",
  253. [274] = "Dwn",
  254. [275] = "Rgt",
  255. [276] = "Lft",
  256. [277] = "Ins",
  257. [278] = "Hme",
  258. [279] = "End",
  259. [280] = "PgUp",
  260. [281] = "PgDn",
  261. [304] = "Shift",
  262. [303] = "RShift",
  263. [308] = "Alt",
  264. [307] = "RAlt",
  265. [306] = "Ctl",
  266. [305] = "RCtl",
  267. [301] = "Caps",
  268. [300] = "Num",
  269. [302] = "Scrl",
  270. [322] = "Undo",
  271. [282] = "F1",
  272. [283] = "F2",
  273. [284] = "F3",
  274. [285] = "F4",
  275. [286] = "F5",
  276. [287] = "F6",
  277. [288] = "F7",
  278. [289] = "F8",
  279. [290] = "F9",
  280. [291] = "F10",
  281. [292] = "F11",
  282. [293] = "F12",
  283. [294] = "F13",
  284. [295] = "F14",
  285. [296] = "F15",
  286. [1000] = "X",
  287. [1001] = "Y",
  288. [1002] = "A",
  289. [1003] = "B",
  290. [1004] = "R1",
  291. [1005] = "L1",
  292. [1006] = "R2",
  293. [1007] = "L2",
  294. [1008] = "R3",
  295. [1009] = "L3",
  296. [1010] = "Start",
  297. [1011] = "Sel",
  298. [1012] = "PadL",
  299. [1013] = "PadR",
  300. [1014] = "PadU",
  301. [1015] = "PadD",
  302. [1016] = "Stick1",
  303. [1017] = "Stick2"
  304. }
  305. local keybindValues2 = {
  306. [0] = "MB1",
  307. [1] = "MB2",
  308. [2] = "MMB",
  309. [3] = "Scroll"
  310. }
  311. local keybindNames = {
  312. BRotate_KB = "Build Rotate",
  313. BSlot1_KB = "Build Slot 1",
  314. BSlot2_KB = "Build Slot 2",
  315. BSlot3_KB = "Build Slot 3",
  316. Build_KB = "Toggle Build",
  317. Crouch_KB = "Toggle Crouch",
  318. Emote_KB = "Use Emote",
  319. Inventory_KB = "Open Inventory",
  320. Map_KB = "Open Map",
  321. Pickup_KB = "Search/Pickup/Revive",
  322. Slot1_KB = "Item Slot 1",
  323. Slot2_KB = "Item Slot 2",
  324. Slot3_KB = "Item Slot 3",
  325. Slot4_KB = "Item Slot 4",
  326. Slot5_KB = "Item Slot 5",
  327. Slot6_KB = "Item Slot 6",
  328. Sprint_KB = "Sprint",
  329. Reload_KB = "Reload",
  330. ADS_KB = "Aim/Scope",
  331. MatSwap_XKB = "Change Build Material",
  332. FireUse_XKB = "Fire/Use/Hit",
  333. Keybinds_KB = "Coming Soon"
  334. }
  335. local savingKeybinds = false
  336. local changingKeybind = false
  337. local hasChangedKeybind = false
  338. local preKeybindEdit = {}
  339. local function setDefaults()
  340. hasChangedKeybind = true
  341. for i, c in pairs(playerData:GetChildren()) do
  342. if string.find(c.Name, "_KB") and game.ReplicatedStorage.Player_Data.Default:FindFirstChild(c.Name) then
  343. c.Value = game.ReplicatedStorage.Player_Data.Default[c.Name].Value
  344. end
  345. end
  346. for i, c in pairs(playerData:GetChildren()) do
  347. pcall(function()
  348. if string.find(c.Name, "_KB") then
  349. preKeybindEdit[c.Name] = c.Value
  350. if coreUI.Keybinds.Base.Info.Keybinds:FindFirstChild(c.Name) then
  351. if keybindValues2[c.Value] then
  352. coreUI.Keybinds.Base.Info.Keybinds[c.Name].SetBind.Text = string.upper(keybindValues2[c.Value])
  353. elseif keybindValues[c.Value] then
  354. coreUI.Keybinds.Base.Info.Keybinds[c.Name].SetBind.Text = string.upper(keybindValues[c.Value])
  355. else
  356. coreUI.Keybinds.Base.Info.Keybinds[c.Name].SetBind.Text = "NONE"
  357. end
  358. end
  359. end
  360. end)
  361. end
  362. end
  363. local function saveKeybinds()
  364. savingKeybinds = true
  365. coreUI.Keybinds.Base.Top.Save.Text = "Saving"
  366. if hasChangedKeybind then
  367. hasChangedKeybind = false
  368. if changingKeybind and changingKeybind[1] and changingKeybind[2] then
  369. if keybindValues2[preKeybindEdit[changingKeybind[2].Name]] then
  370. changingKeybind[1].Text = keybindValues2[preKeybindEdit[changingKeybind[2].Name]]
  371. elseif keybindValues[preKeybindEdit[changingKeybind[2].Name]] then
  372. changingKeybind[1].Text = keybindValues[preKeybindEdit[changingKeybind[2].Name]]
  373. end
  374. end
  375. changingKeybind = false
  376. local newKeybinds = {}
  377. for i, c in pairs(playerData:GetChildren()) do
  378. if string.find(c.Name, "_KB") then
  379. newKeybinds[c.Name] = c.Value
  380. end
  381. end
  382. remoteFunctions.Save_Keybinds:InvokeServer(newKeybinds)
  383. checkUpdate()
  384. else
  385. if changingKeybind and changingKeybind[1] and changingKeybind[2] then
  386. if keybindValues2[preKeybindEdit[changingKeybind[2].Name]] then
  387. changingKeybind[1].Text = keybindValues2[preKeybindEdit[changingKeybind[2].Name]]
  388. elseif keybindValues[preKeybindEdit[changingKeybind[2].Name]] then
  389. changingKeybind[1].Text = keybindValues[preKeybindEdit[changingKeybind[2].Name]]
  390. end
  391. end
  392. changingKeybind = false
  393. end
  394. coreUI.Keybinds.Base.Top.Save.Text = "Saved!"
  395. wait(1)
  396. coreUI.Keybinds.Base.Top.Save.Text = "Save"
  397. savingKeybinds = false
  398. end
  399. local function editKeybind(obj, bind)
  400. if not changingKeybind and not savingKeybinds then
  401. obj.Text = "PRESS KEY"
  402. changingKeybind = {obj, bind}
  403. end
  404. end
  405. buttonModule.handleButton(coreUI.Keybinds.Base.Top.Save, saveKeybinds)
  406. buttonModule.handleButton(coreUI.Keybinds.Base.Top.Default, setDefaults)
  407. UIS.InputBegan:connect(function(input)
  408. if changingKeybind and not savingKeybinds then
  409. if input and input.KeyCode and input.KeyCode.Value and changingKeybind[1] and changingKeybind[2] and keybindValues[input.KeyCode.Value] and input.KeyCode.Value ~= 0 then
  410. hasChangedKeybind = true
  411. changingKeybind[2].Value = input.KeyCode.Value
  412. changingKeybind[1].Text = keybindValues[input.KeyCode.Value]
  413. changingKeybind = false
  414. elseif input and input.UserInputType and string.find(input.UserInputType.Name, "MouseButton") and input.UserInputType.Value and changingKeybind[1] and changingKeybind[2] and keybindValues2[input.UserInputType.Value] and 1 < input.UserInputType.Value and 2 >= input.UserInputType.Value then
  415. hasChangedKeybind = true
  416. changingKeybind[2].Value = input.UserInputType.Value
  417. changingKeybind[1].Text = keybindValues2[input.UserInputType.Value]
  418. changingKeybind = false
  419. else
  420. if keybindValues2[preKeybindEdit[changingKeybind[2].Name]] then
  421. changingKeybind[1].Text = keybindValues2[preKeybindEdit[changingKeybind[2].Name]]
  422. elseif keybindValues[preKeybindEdit[changingKeybind[2].Name]] then
  423. changingKeybind[1].Text = keybindValues[preKeybindEdit[changingKeybind[2].Name]]
  424. end
  425. changingKeybind = false
  426. end
  427. end
  428. end)
  429. function checkUpdate()
  430. if selectedPage ~= 12 and hasChangedKeybind then
  431. for i, c in pairs(playerData:GetChildren()) do
  432. if c and preKeybindEdit[c.Name] then
  433. c.Value = preKeybindEdit[c.Name]
  434. end
  435. end
  436. end
  437. if selectedPage == 2 then
  438. for i, c in pairs(coreUI.Locker.Base.Base:GetChildren()) do
  439. if c.Name == "Glider" or c.Name == "Clothing" or c.Name == "Hat" or c.Name == "Tool" or c.Name == "Face" or c.Name == "Win Effect" or c.Name == "Death Effect" or c.Name == "Dive Trail" or c.Name == "Bullet Trail" or c.Name == "Emote" then
  440. local useName = c.Name
  441. if c.Name == "Win Effect" or c.Name == "Death Effect" then
  442. useName = "Effect"
  443. elseif c.Name == "Dive Trail" or c.Name == "Bullet Trail" then
  444. useName = "Trail"
  445. end
  446. if playerData:FindFirstChild(c.Name) and game.ReplicatedStorage.Character_Clothing[useName]:FindFirstChild(playerData[c.Name].Value) then
  447. c.Base.ItemName.Text = playerData[c.Name].Value
  448. if game.ReplicatedStorage.Character_Clothing[useName][playerData[c.Name].Value]:FindFirstChild("Image") then
  449. c.Base.Icon.Image = "rbxassetid://" .. game.ReplicatedStorage.Character_Clothing[useName][playerData[c.Name].Value].Image.Value
  450. else
  451. c.Base.Icon.Image = ""
  452. end
  453. if game.ReplicatedStorage.Character_Clothing[useName][playerData[c.Name].Value]:FindFirstChild("Level") then
  454. local level = game.ReplicatedStorage.Character_Clothing[useName][playerData[c.Name].Value].Level.Value
  455. c.BackgroundColor3 = levelData[level]
  456. else
  457. c.BackgroundColor3 = levelData[1]
  458. end
  459. if game.ReplicatedStorage.Character_Clothing[useName][playerData[c.Name].Value]:FindFirstChild("Color") then
  460. c.Base.Icon.Image = ""
  461. c.BackgroundColor3 = game.ReplicatedStorage.Character_Clothing[useName][playerData[c.Name].Value].Color.Value.Color
  462. end
  463. end
  464. end
  465. end
  466. elseif selectedPage == 4 then
  467. coreUI.Stats.Base.Top.Top.Longshot.Text = "Farthest Shot: " .. playerData.Farthest_Shot.Value .. "m"
  468. coreUI.Stats.Base.Info.Solo_Wins.Text = "Solo Wins: " .. playerData.Solo_Wins.Value
  469. coreUI.Stats.Base.Info.Solo_Kills.Text = "Solo Kills: " .. playerData.Solo_Kills.Value
  470. coreUI.Stats.Base.Info.Solo_Place.Text = "Top Solo Placement: " .. playerData.Solo_Place.Value
  471. local calcKDR = 0
  472. if playerData.Solo_Kills.Value > 0 and 0 < playerData.Solo_Deaths.Value then
  473. calcKDR = playerData.Solo_Kills.Value / playerData.Solo_Deaths.Value
  474. elseif playerData.Solo_Kills.Value > 0 and playerData.Solo_Deaths.Value == 0 then
  475. calcKDR = playerData.Solo_Kills.Value
  476. end
  477. coreUI.Stats.Base.Info.Solo_KDR.Text = "Solo KDR: " .. calcKDR
  478. coreUI.Stats.Base.Info.Solo_Wins_Total.Text = "Solo Wins: " .. playerData.Solo_Wins_Total.Value
  479. coreUI.Stats.Base.Info.Solo_Kills_Total.Text = "Solo Kills: " .. playerData.Solo_Kills_Total.Value
  480. coreUI.Stats.Base.Info.Solo_Place_Total.Text = "Top Solo Placement: " .. playerData.Solo_Place_Total.Value
  481. local calcKDR = 0
  482. if 0 < playerData.Solo_Kills_Total.Value and 0 < playerData.Solo_Deaths_Total.Value then
  483. calcKDR = playerData.Solo_Kills_Total.Value / playerData.Solo_Deaths_Total.Value
  484. elseif 0 < playerData.Solo_Kills_Total.Value and playerData.Solo_Deaths_Total.Value == 0 then
  485. calcKDR = playerData.Solo_Kills_Total.Value
  486. end
  487. coreUI.Stats.Base.Info.Solo_KDR_Total.Text = "Solo KDR: " .. calcKDR
  488. coreUI.Stats.Base.Info.Duo_Wins.Text = "Duo Wins: " .. playerData.Duo_Wins.Value
  489. coreUI.Stats.Base.Info.Duo_Kills.Text = "Duo Kills: " .. playerData.Duo_Kills.Value
  490. coreUI.Stats.Base.Info.Duo_Place.Text = "Top Duo Placement: " .. playerData.Duo_Place.Value
  491. local calcKDR = 0
  492. if 0 < playerData.Duo_Kills.Value and 0 < playerData.Duo_Deaths.Value then
  493. calcKDR = playerData.Duo_Kills.Value / playerData.Duo_Deaths.Value
  494. elseif 0 < playerData.Duo_Kills.Value and playerData.Duo_Deaths.Value == 0 then
  495. calcKDR = playerData.Duo_Kills.Value
  496. end
  497. coreUI.Stats.Base.Info.Duo_KDR.Text = "Duo KDR: " .. calcKDR
  498. coreUI.Stats.Base.Info.Duo_Wins_Total.Text = "Duo Wins: " .. playerData.Duo_Wins_Total.Value
  499. coreUI.Stats.Base.Info.Duo_Kills_Total.Text = "Duo Kills: " .. playerData.Duo_Kills_Total.Value
  500. coreUI.Stats.Base.Info.Duo_Place_Total.Text = "Top Duo Placement: " .. playerData.Duo_Place_Total.Value
  501. local calcKDR = 0
  502. if 0 < playerData.Duo_Kills_Total.Value and 0 < playerData.Duo_Deaths_Total.Value then
  503. calcKDR = playerData.Duo_Kills_Total.Value / playerData.Duo_Deaths_Total.Value
  504. elseif 0 < playerData.Duo_Kills_Total.Value and playerData.Duo_Deaths_Total.Value == 0 then
  505. calcKDR = playerData.Duo_Kills_Total.Value
  506. end
  507. coreUI.Stats.Base.Info.Duo_KDR_Total.Text = "Duo KDR: " .. calcKDR
  508. coreUI.Stats.Base.Info.Squad_Wins.Text = "Squad Wins: " .. playerData.Squad_Wins.Value
  509. coreUI.Stats.Base.Info.Squad_Kills.Text = "Squad Kills: " .. playerData.Squad_Kills.Value
  510. coreUI.Stats.Base.Info.Squad_Place.Text = "Top Squad Placement: " .. playerData.Squad_Place.Value
  511. local calcKDR = 0
  512. if 0 < playerData.Squad_Kills.Value and 0 < playerData.Squad_Deaths.Value then
  513. calcKDR = playerData.Squad_Kills.Value / playerData.Squad_Deaths.Value
  514. elseif 0 < playerData.Squad_Kills.Value and playerData.Squad_Deaths.Value == 0 then
  515. calcKDR = playerData.Squad_Kills.Value
  516. end
  517. coreUI.Stats.Base.Info.Squad_KDR.Text = "Squad KDR: " .. calcKDR
  518. coreUI.Stats.Base.Info.Squad_Wins_Total.Text = "Squad Wins: " .. playerData.Squad_Wins_Total.Value
  519. coreUI.Stats.Base.Info.Squad_Kills_Total.Text = "Squad Kills: " .. playerData.Squad_Kills_Total.Value
  520. coreUI.Stats.Base.Info.Squad_Place_Total.Text = "Top Squad Placement: " .. playerData.Squad_Place_Total.Value
  521. local calcKDR = 0
  522. if 0 < playerData.Squad_Kills_Total.Value and 0 < playerData.Squad_Deaths_Total.Value then
  523. calcKDR = playerData.Squad_Kills_Total.Value / playerData.Squad_Deaths_Total.Value
  524. elseif 0 < playerData.Squad_Kills_Total.Value and playerData.Squad_Deaths_Total.Value == 0 then
  525. calcKDR = playerData.Squad_Kills_Total.Value
  526. end
  527. coreUI.Stats.Base.Info.Squad_KDR_Total.Text = "Squad KDR: " .. calcKDR
  528. elseif selectedPage == 10 then
  529. local hasChanged = 0
  530. local isFree = false
  531. if playerData.First_Join.Value == 0 then
  532. isFree = true
  533. coreUI.Edit.Base.Base.First.Visible = true
  534. else
  535. coreUI.Edit.Base.Base.First.Visible = false
  536. end
  537. for i, c in pairs(playerData:GetChildren()) do
  538. if beforeEdit[c.Name] and beforeEdit[c.Name] ~= c.Value then
  539. hasChanged = hasChanged + 1
  540. end
  541. end
  542. local totalCost = 500 * hasChanged
  543. if hasChanged > 0 then
  544. coreUI.Edit.Base.Base.Cost.Visible = true
  545. coreUI.Edit.Base.Base.Purchase.Visible = true
  546. if isFree then
  547. coreUI.Edit.Base.Base.Purchase.Text = "Apply Edits"
  548. coreUI.Edit.Base.Base.Cost.Cost.Text = "FREE"
  549. else
  550. coreUI.Edit.Base.Base.Purchase.Text = "Purchase Edits"
  551. coreUI.Edit.Base.Base.Cost.Cost.Text = commaSeperate(totalCost)
  552. end
  553. else
  554. coreUI.Edit.Base.Base.Cost.Visible = false
  555. coreUI.Edit.Base.Base.Purchase.Visible = false
  556. end
  557. elseif selectedPage == 3 then
  558. for i, c in pairs(coreUI.ItemShop.Base.Shop.Base:GetChildren()) do
  559. pcall(function()
  560. if c.ClassName == "ImageButton" and not string.find(c.Name, "Chest") then
  561. if string.find(playerData.Owned_Items.Value, c.ItemName.Value .. ":") then
  562. c.Owned.Visible = true
  563. c.Cost.Visible = false
  564. else
  565. c.Owned.Visible = false
  566. c.Cost.Visible = true
  567. end
  568. local realItem = game.ReplicatedStorage.Character_Clothing[c.Category.Value][c.ItemName.Value]
  569. if realItem:FindFirstChild("Image") then
  570. c.Icon.Image = "rbxassetid://" .. realItem.Image.Value
  571. end
  572. c.Base.Title.Text = realItem.Name
  573. c.Base.Type.Text = realItem.Parent.Name
  574. if realItem:FindFirstChild("Level") then
  575. c.BackgroundColor3 = levelData[realItem.Level.Value]
  576. else
  577. c.BackgroundColor3 = levelData[1]
  578. end
  579. c.Cost.Cost.Text = commaSeperate(realItem.Cost.Value)
  580. end
  581. end)
  582. end
  583. elseif selectedPage == 12 then
  584. hasChangedKeybind = false
  585. changingKeybind = false
  586. preKeybindEdit = {}
  587. for i, cc in pairs(keybindNames) do
  588. pcall(function()
  589. if playerData:FindFirstChild(i) then
  590. local c = playerData[i]
  591. if string.find(c.Name, "_KB") or string.find(c.Name, "_XKB") then
  592. preKeybindEdit[c.Name] = c.Value
  593. if not coreUI.Keybinds.Base.Info.Keybinds:FindFirstChild(c.Name) then
  594. local newBind = script.Keybind:Clone()
  595. newBind.Name = c.Name
  596. if keybindNames[c.Name] then
  597. newBind.BindName.Text = keybindNames[c.Name]
  598. else
  599. newBind.BindName.Text = "UNKNOWN"
  600. end
  601. local canChange = true
  602. if string.find(c.Name, "_XKB") then
  603. newBind.SetBind.AutoButtonColor = false
  604. newBind.BackgroundColor3 = Color3.new(0.07450980392156863, 0.1843137254901961, 0.24705882352941178)
  605. newBind.SetBind.Selectable = false
  606. canChange = false
  607. end
  608. if keybindValues2[c.Value] then
  609. newBind.SetBind.Text = string.upper(keybindValues2[c.Value])
  610. elseif keybindValues[c.Value] then
  611. newBind.SetBind.Text = string.upper(keybindValues[c.Value])
  612. else
  613. newBind.SetBind.Text = "NONE"
  614. end
  615. newBind.Parent = coreUI.Keybinds.Base.Info.Keybinds
  616. if canChange then
  617. buttonModule.handleButton(newBind.SetBind, editKeybind, {
  618. newBind.SetBind,
  619. c
  620. })
  621. end
  622. elseif keybindValues2[c.Value] then
  623. coreUI.Keybinds.Base.Info.Keybinds[c.Name].SetBind.Text = string.upper(keybindValues2[c.Value])
  624. elseif keybindValues[c.Value] then
  625. coreUI.Keybinds.Base.Info.Keybinds[c.Name].SetBind.Text = string.upper(keybindValues[c.Value])
  626. else
  627. coreUI.Keybinds.Base.Info.Keybinds[c.Name].SetBind.Text = "NONE"
  628. end
  629. end
  630. end
  631. end)
  632. end
  633. end
  634. end
  635. local function swapPage(old)
  636. checkUpdate()
  637. pages[old]:TweenPosition(UDim2.new(-1, 0, 0, 0), "Out", "Quart", 0.25, true)
  638. pages[selectedPage].Visible = true
  639. pages[selectedPage]:TweenPosition(UDim2.new(0, 0, 0, 0), "Out", "Quart", 0.25, true)
  640. if selectedPage ~= 1 then
  641. spawn(function()
  642. openInvite(true)
  643. end)
  644. if selectedPage ~= 10 then
  645. game.Lighting.Blur_Effect.Size = 50
  646. else
  647. game.Lighting.Blur_Effect.Size = 4
  648. end
  649. else
  650. game.Lighting.Blur_Effect.Size = 4
  651. end
  652. wait(0.255)
  653. if pages[old].Position == UDim2.new(-1, 0, 0, 0) then
  654. pages[old].Visible = false
  655. end
  656. end
  657. local function swapStorePage(swapVal, instant)
  658. storeSwapped = swapVal
  659. local timeTo = 0.25
  660. if instant then
  661. timeTo = 0
  662. end
  663. if storeSwapped then
  664. coreUI.Store.Base.Page2:TweenPosition(UDim2.new(-1.504, 0, 0.525, 0), "Out", "Quart", timeTo, true)
  665. coreUI.Store.Base.Page.Visible = true
  666. coreUI.Store.Base.Page:TweenPosition(UDim2.new(0.504, 0, 0.525, 0), "Out", "Quart", timeTo, true)
  667. wait(timeTo)
  668. if coreUI.Store.Base.Page2.Position == UDim2.new(-1.504, 0, 0.525, 0) then
  669. coreUI.Store.Base.Page2.Visible = false
  670. end
  671. else
  672. coreUI.Store.Base.Page:TweenPosition(UDim2.new(1.504, 0, 0.525, 0), "Out", "Quart", timeTo, true)
  673. coreUI.Store.Base.Page2.Visible = true
  674. coreUI.Store.Base.Page2:TweenPosition(UDim2.new(0.504, 0, 0.525, 0), "Out", "Quart", timeTo, true)
  675. wait(timeTo)
  676. if coreUI.Store.Base.Page.Position == UDim2.new(1.504, 0, 0.525, 0) then
  677. coreUI.Store.Base.Page.Visible = false
  678. end
  679. end
  680. end
  681. local function doFillToggle()
  682. if not callingToggleFill then
  683. callingToggleFill = true
  684. remoteFunctions.Toggle_Fill:InvokeServer(not Player.Data.Fill.Value)
  685. callingToggleFill = false
  686. end
  687. end
  688. local function doTypeToggle()
  689. if not callingToggleType then
  690. callingToggleType = true
  691. remoteFunctions.Change_Type:InvokeServer()
  692. callingToggleType = false
  693. end
  694. end
  695. local function changePageNumber(typeTo, setTo, isEditing)
  696. playPreviewSound()
  697. if not isEditing then
  698. if doingEdit then
  699. doingEdit = false
  700. if not purchasedEdits then
  701. for i, c in pairs(playerData:GetChildren()) do
  702. if beforeEdit[c.Name] then
  703. c.Value = beforeEdit[c.Name]
  704. end
  705. end
  706. end
  707. purchasedEdits = false
  708. end
  709. else
  710. coreUI.Edit.Base.Base.Color.Base.ItemName.Text = ""
  711. coreUI.Edit.Base.Base.Color.Icon.ImageTransparency = 1
  712. coreUI.Edit.Base.Base.Color.Icon.BackgroundTransparency = 0
  713. coreUI.Edit.Base.Base.Color.Icon.BackgroundColor3 = playerData["Hair Color"].Value.Color
  714. coreUI.Edit.Base.Base.Skin.Base.ItemName.Text = ""
  715. coreUI.Edit.Base.Base.Skin.Icon.ImageTransparency = 1
  716. coreUI.Edit.Base.Base.Skin.Icon.BackgroundTransparency = 0
  717. coreUI.Edit.Base.Base.Skin.Icon.BackgroundColor3 = playerData["Skin Color"].Value.Color
  718. coreUI.Edit.Base.Base.Hair.Base.ItemName.Text = playerData.Hair.Value
  719. if game.ReplicatedStorage.Character_Clothing.Hair:FindFirstChild(playerData.Hair.Value) then
  720. coreUI.Edit.Base.Base.Hair.Base.Icon.Image = "rbxassetid://" .. game.ReplicatedStorage.Character_Clothing.Hair:FindFirstChild(playerData.Hair.Value).Image.Value
  721. end
  722. end
  723. local old = selectedPage
  724. if typeTo == 1 then
  725. selectedPage = selectedPage + 1
  726. elseif typeTo == 2 then
  727. selectedPage = selectedPage - 1
  728. elseif typeTo == 3 then
  729. selectedPage = setTo
  730. end
  731. swapPage(old)
  732. end
  733. local function shopToStore(val)
  734. swapStorePage(val, true)
  735. changePageNumber(3, 6)
  736. end
  737. local function toggleEdit(val)
  738. if val then
  739. doingEdit = true
  740. beforeEdit = {
  741. ["Skin Color"] = playerData["Skin Color"].Value,
  742. Hair = playerData.Hair.Value,
  743. ["Hair Color"] = playerData["Hair Color"].Value
  744. }
  745. changePageNumber(3, 10, true)
  746. else
  747. doingEdit = false
  748. if not purchasedEdits then
  749. for i, c in pairs(playerData:GetChildren()) do
  750. if beforeEdit[c.Name] then
  751. c.Value = beforeEdit[c.Name]
  752. end
  753. end
  754. end
  755. purchasedEdits = false
  756. changePageNumber(3, 2, true)
  757. end
  758. end
  759. local function tooPoor(neededFunds)
  760. local useThis
  761. for i, c in pairs(creditTiers) do
  762. if neededFunds <= c or i == #creditTiers then
  763. useThis = i
  764. break
  765. end
  766. end
  767. marketplaceService:PromptProductPurchase(Player, tierIds[useThis])
  768. end
  769. local function doEditPurchase()
  770. local hasEdited = false
  771. if not purchasedEdits then
  772. for i, c in pairs(playerData:GetChildren()) do
  773. if beforeEdit[c.Name] and beforeEdit[c.Name] ~= c.Value then
  774. hasEdited = true
  775. end
  776. end
  777. end
  778. if hasEdited then
  779. local hasChanged = 0
  780. for i, c in pairs(playerData:GetChildren()) do
  781. if beforeEdit[c.Name] and beforeEdit[c.Name] ~= c.Value then
  782. hasChanged = hasChanged + 1
  783. end
  784. end
  785. local totalCost = 500 * hasChanged
  786. if totalCost <= playerData.Credits.Value or playerData.First_Join.Value == 0 then
  787. do
  788. local afterEdit = {}
  789. for i, c in pairs(playerData:GetChildren()) do
  790. if beforeEdit[c.Name] and beforeEdit[c.Name] ~= c.Value then
  791. afterEdit[c.Name] = c.Value
  792. end
  793. end
  794. if pcall(function()
  795. remoteFunctions.Edit_Character:InvokeServer(afterEdit)
  796. end) then
  797. doingEdit = false
  798. changePageNumber(3, 2)
  799. end
  800. end
  801. else
  802. tooPoor(totalCost - playerData.Credits.Value)
  803. end
  804. else
  805. changePageNumber(3, 2)
  806. end
  807. end
  808. local function equipSelectedEdit(itemName, itemCategory)
  809. playerData[itemCategory].Value = itemName
  810. changePageNumber(3, 10, true)
  811. end
  812. local function equipSelected(itemName, itemCategory, dataName)
  813. if not doingEquip then
  814. doingEquip = true
  815. remoteFunctions.Equip_Item:InvokeServer(itemName, itemCategory, dataName)
  816. changePageNumber(3, 2)
  817. doingEquip = false
  818. end
  819. end
  820. local function buyItemShop(itemName, itemCategory)
  821. if not doingBuy and game.ReplicatedStorage.Character_Clothing:FindFirstChild(itemCategory) and game.ReplicatedStorage.Character_Clothing[itemCategory]:FindFirstChild(itemName) and not string.find(playerData.Owned_Items.Value, itemName .. ":") then
  822. if playerData.Credits.Value >= game.ReplicatedStorage.Character_Clothing[itemCategory][itemName].Cost.Value then
  823. doingBuy = true
  824. if remoteFunctions.Buy_Item:InvokeServer(itemName, itemCategory) then
  825. script.Purchase:Play()
  826. end
  827. checkUpdate()
  828. doingBuy = false
  829. else
  830. tooPoor(game.ReplicatedStorage.Character_Clothing[itemCategory][itemName].Cost.Value - playerData.Credits.Value)
  831. end
  832. end
  833. end
  834. local function buyChestShop(itemName)
  835. if not doingBuyChest and game.ReplicatedStorage.Chests:FindFirstChild(itemName) then
  836. if playerData.Credits.Value >= game.ReplicatedStorage.Chests[itemName].Cost.Value then
  837. doingBuyChest = true
  838. do
  839. local obj, prev = remoteFunctions.Buy_Chest:InvokeServer(itemName)
  840. if obj then
  841. spawn(function()
  842. local newitem = coreUI.Unboxed.Base.Woot.Base.Recieved
  843. if obj:FindFirstChild("Image") then
  844. newitem.Icon.Image = "rbxassetid://" .. obj.Image.Value
  845. else
  846. newitem.Icon.Image = "rbxassetid://1337"
  847. end
  848. newitem.Bottom.ItemName.Text = obj.Name
  849. newitem.Bottom.ItemCat.Text = obj.Parent.Name
  850. if obj:FindFirstChild("Level") then
  851. newitem.BackgroundColor3 = levelData[obj.Level.Value]
  852. else
  853. newitem.BackgroundColor3 = levelData[1]
  854. end
  855. if obj:FindFirstChild("Color") then
  856. newitem.Icon.Image = "0"
  857. newitem.BackgroundTransparency = 0
  858. newitem.BackgroundColor3 = obj.Color.Value.Color
  859. end
  860. if prev then
  861. coreUI.Unboxed.Base.Woot.Base.Duplicate.Visible = true
  862. else
  863. coreUI.Unboxed.Base.Woot.Base.Duplicate.Visible = false
  864. end
  865. end)
  866. coreUI.Unboxed:TweenPosition(UDim2.new(0, 0, 0, 0), "Out", "Quart", 0.25, true)
  867. script.Chest_Open:Play()
  868. wait(2.75)
  869. coreUI.Unboxed:TweenPosition(UDim2.new(0, 0, -1, 0), "Out", "Quart", 0.25, true)
  870. end
  871. checkUpdate()
  872. doingBuyChest = false
  873. end
  874. else
  875. tooPoor(game.ReplicatedStorage.Chests[itemName].Cost.Value - playerData.Credits.Value)
  876. end
  877. end
  878. end
  879. local possibleItemsChest = {}
  880. for i, c in pairs(game.ReplicatedStorage.Character_Clothing:GetChildren()) do
  881. if c.Name == "Clothing" or c.Name == "Face" or c.Name == "Glider" or c.Name == "Hat" or c.Name == "Tool" then
  882. for ii, cc in pairs(c:GetChildren()) do
  883. if cc.Name ~= "Normal" and cc.Name ~= "None" and cc.Name ~= "Pickaxe" and not cc:FindFirstChild("Featured") then
  884. table.insert(possibleItemsChest, cc)
  885. end
  886. end
  887. end
  888. end
  889. local possibleItemsChest2 = {}
  890. for i, c in pairs(game.ReplicatedStorage.Character_Clothing:GetChildren()) do
  891. if c.Name == "Effect" or c.Name == "Trail" or c.Name == "Emote" then
  892. for ii, cc in pairs(c:GetChildren()) do
  893. if cc.Name ~= "Normal" and cc.Name ~= "None" and cc.Name ~= "Pickaxe" and not cc:FindFirstChild("Featured") then
  894. table.insert(possibleItemsChest2, cc)
  895. end
  896. end
  897. end
  898. end
  899. function playPreviewSound(soundId, button)
  900. if not soundId then
  901. if currentlyPlaying then
  902. currentlyPlaying:Stop()
  903. currentlyPlayingButton.Icon.Image = "rbxassetid://1351656403"
  904. currentlyPlaying:Destroy()
  905. end
  906. else
  907. if currentlyPlaying then
  908. currentlyPlaying:Stop()
  909. currentlyPlayingButton.Icon.Image = "rbxassetid://1351656403"
  910. end
  911. if currentlyPlayingButton == button then
  912. currentlyPlaying:Destroy()
  913. currentlyPlayingButton = nil
  914. currentlyPlaying = nil
  915. else
  916. if currentlyPlaying then
  917. currentlyPlaying:Destroy()
  918. currentlyPlayingButton = nil
  919. currentlyPlaying = nil
  920. end
  921. currentlyPlaying = Instance.new("Sound")
  922. currentlyPlaying.SoundId = "rbxassetid://" .. soundId
  923. currentlyPlayingButton = button
  924. currentlyPlayingButton.Icon.Image = "rbxassetid://1351656404"
  925. currentlyPlaying.Name = "Preview_Sound"
  926. currentlyPlaying.Parent = script
  927. currentlyPlaying:Play()
  928. end
  929. end
  930. end
  931. local function swapToPossibles(viewName)
  932. if game.ReplicatedStorage.Chests:FindFirstChild(viewName) then
  933. for i, c in pairs(coreUI.Possibles.Base.Bottom.Holder:GetChildren()) do
  934. if c.ClassName == "TextButton" then
  935. c:Destroy()
  936. end
  937. end
  938. local useThis = possibleItemsChest
  939. if viewName == "Chest 2" then
  940. useThis = possibleItemsChest2
  941. end
  942. for i, c in pairs(useThis) do
  943. local newitem = script.ItemPossible:Clone()
  944. if c:FindFirstChild("Image") then
  945. newitem.Icon.Image = "rbxassetid://" .. c.Image.Value
  946. end
  947. newitem.Selectable = false
  948. newitem.AutoButtonColor = false
  949. newitem.Bottom.ItemName.Text = c.Name
  950. newitem.Bottom.ItemCat.Text = c.Parent.Name
  951. newitem.Name = c.Name
  952. newitem.Parent = coreUI.Possibles.Base.Bottom.Holder
  953. if c:FindFirstChild("Level") then
  954. newitem.BackgroundColor3 = levelData[c.Level.Value]
  955. else
  956. newitem.BackgroundColor3 = levelData[1]
  957. end
  958. if c:FindFirstChild("Color") then
  959. newitem.Icon.Image = "0"
  960. newitem.BackgroundTransparency = 0
  961. newitem.BackgroundColor3 = c.Color.Value.Color
  962. end
  963. if c:FindFirstChild("Sound") then
  964. buttonModule.handleButton(newitem.Play, playPreviewSound, {
  965. c.Sound.Value,
  966. newitem.Play
  967. })
  968. else
  969. newitem.Play:Destroy()
  970. end
  971. end
  972. coreUI.Possibles.Base.Top.Top.Title.Text = string.upper(viewName) .. " CONTAINS"
  973. changePageNumber(3, 9)
  974. coreUI.Possibles.Base.Bottom.Holder.CanvasPosition = Vector2.new(0, 0)
  975. end
  976. end
  977. local function swapToEquip(viewName, dataName)
  978. if game.ReplicatedStorage.Character_Clothing:FindFirstChild(viewName) then
  979. for i, c in pairs(coreUI.Inventory.Base.Bottom.Holder:GetChildren()) do
  980. if c.ClassName == "TextButton" then
  981. c:Destroy()
  982. end
  983. end
  984. for i, c in pairs(game.ReplicatedStorage.Character_Clothing[viewName]:GetChildren()) do
  985. if doingEdit or c.Name == "Normal" or c.Name == "Normal2" or c.Name == "None" or c.Name == "Pickaxe" or playerData[dataName].Value == c.Name or string.find(playerData.Owned_Items.Value, c.Name .. ":") then
  986. local newitem = script.Item:Clone()
  987. if c:FindFirstChild("Image") then
  988. newitem.Icon.Image = "rbxassetid://" .. c.Image.Value
  989. end
  990. newitem.Bottom.ItemName.Text = c.Name
  991. newitem.Name = c.Name
  992. newitem.Parent = coreUI.Inventory.Base.Bottom.Holder
  993. if playerData[dataName].Value == c.Name then
  994. newitem.BorderSizePixel = 3
  995. end
  996. if c:FindFirstChild("Level") then
  997. newitem.BackgroundColor3 = levelData[c.Level.Value]
  998. else
  999. newitem.BackgroundColor3 = levelData[1]
  1000. end
  1001. if string.find(viewName, "Color") then
  1002. newitem.Icon.Image = "0"
  1003. newitem.BackgroundTransparency = 0
  1004. newitem.BackgroundColor3 = c.Value.Color
  1005. end
  1006. if c:FindFirstChild("Color") then
  1007. newitem.Icon.Image = "0"
  1008. newitem.BackgroundTransparency = 0
  1009. newitem.BackgroundColor3 = c.Color.Value.Color
  1010. end
  1011. if doingEdit then
  1012. if string.find(viewName, "Color") then
  1013. buttonModule.handleButton(newitem, equipSelectedEdit, {
  1014. c.Value,
  1015. viewName
  1016. })
  1017. else
  1018. buttonModule.handleButton(newitem, equipSelectedEdit, {
  1019. c.Name,
  1020. viewName
  1021. })
  1022. end
  1023. else
  1024. buttonModule.handleButton(newitem, equipSelected, {
  1025. c.Name,
  1026. viewName,
  1027. dataName
  1028. })
  1029. end
  1030. if c:FindFirstChild("Sound") then
  1031. buttonModule.handleButton(newitem.Play, playPreviewSound, {
  1032. c.Sound.Value,
  1033. newitem.Play
  1034. })
  1035. else
  1036. newitem.Play:Destroy()
  1037. end
  1038. end
  1039. end
  1040. if not doingEdit then
  1041. coreUI.Inventory.Base.Top.Top.Title.Text = string.upper(viewName) .. " - OWNED"
  1042. changePageNumber(3, 8)
  1043. else
  1044. coreUI.Inventory.Base.Top.Top.Title.Text = string.upper(viewName)
  1045. changePageNumber(3, 8, true)
  1046. end
  1047. coreUI.Inventory.Base.Bottom.Holder.CanvasPosition = Vector2.new(0, 0)
  1048. end
  1049. end
  1050. function openInvite(override)
  1051. if not togglingInvite or override then
  1052. togglingInvite = true
  1053. if override then
  1054. friendsOpen = false
  1055. elseif not Player.Data.Waiting.Value and not Player.Data.Line.Value and not Player.Data.Ready.Value then
  1056. friendsOpen = not friendsOpen
  1057. else
  1058. friendsOpen = false
  1059. end
  1060. if friendsOpen then
  1061. if selectedPage ~= 1 then
  1062. changePageNumber(3, 1)
  1063. end
  1064. coreUI.Friends.Visible = true
  1065. coreUI.Friends:TweenPosition(UDim2.new(0.8, 0, 0.285, 0), "Out", "Quart", 0.25, true)
  1066. else
  1067. coreUI.Friends:TweenPosition(UDim2.new(1.05, 0, 0.285, 0), "Out", "Quart", 0.25, true)
  1068. spawn(function()
  1069. wait(0.255)
  1070. if coreUI.Friends.Position == UDim2.new(1.05, 0, 0.285, 0) then
  1071. coreUI.Friends.Visible = false
  1072. end
  1073. end)
  1074. end
  1075. wait(0.125)
  1076. togglingInvite = false
  1077. end
  1078. end
  1079. local function doMatching()
  1080. if not callingMatching then
  1081. callingMatching = true
  1082. spawn(function()
  1083. openInvite(true)
  1084. end)
  1085. remoteFunctions.Toggle_Matching:InvokeServer()
  1086. wait(1)
  1087. callingMatching = false
  1088. end
  1089. end
  1090. local function declineInvite()
  1091. if invitePlayer then
  1092. invitePlayer = nil
  1093. end
  1094. end
  1095. local function acceptInvite()
  1096. if invitePlayer then
  1097. remoteEvents.Join_Group:FireServer(invitePlayer)
  1098. invitePlayer = nil
  1099. end
  1100. end
  1101. local function leaveGroup()
  1102. if not leavingGroup then
  1103. leavingGroup = true
  1104. remoteEvents.Leave_Group:FireServer()
  1105. wait(1)
  1106. leavingGroup = false
  1107. end
  1108. end
  1109. local function redeemCode()
  1110. if canUseCode and coreUI.Codes.Base.Holder.CodeBox.Text ~= "" and coreUI.Codes.Base.Holder.CodeBox.Text ~= " " and coreUI.Codes.Base.Holder.CodeBox.Text ~= "Enter Code Here" then
  1111. canUseCode = false
  1112. local note = remoteFunctions.Twitter_Code:InvokeServer(coreUI.Codes.Base.Holder.CodeBox.Text)
  1113. if note then
  1114. coreUI.Codes.Base.Holder.CodeBox.Text = note
  1115. end
  1116. wait(5)
  1117. coreUI.Codes.Base.Holder.CodeBox.Text = "Enter Code Here"
  1118. canUseCode = true
  1119. else
  1120. coreUI.Codes.Base.Holder.CodeBox.Text = "Enter Code Here"
  1121. end
  1122. end
  1123. local sortTable = function(tab)
  1124. local reversed = {}
  1125. local nums = {}
  1126. for i, c in pairs(tab) do
  1127. if not reversed[c] then
  1128. reversed[c] = {}
  1129. end
  1130. table.insert(reversed[c], i)
  1131. table.insert(nums, c)
  1132. end
  1133. table.sort(nums)
  1134. local newTable = {}
  1135. local current = {}
  1136. for i = #nums, 1, -1 do
  1137. if nums[i] then
  1138. if not current[nums[i]] then
  1139. current[nums[i]] = 1
  1140. else
  1141. current[nums[i]] = current[nums[i]] + 1
  1142. end
  1143. table.insert(newTable, {
  1144. playerName = reversed[nums[i]][current[nums[i]]],
  1145. Val = nums[i]
  1146. })
  1147. end
  1148. end
  1149. return newTable
  1150. end
  1151. local function doThing(tab1, tab2)
  1152. local count = 1
  1153. for i, c in pairs(tab1[1]:GetChildren()) do
  1154. if c.ClassName == "TextLabel" then
  1155. c:Destroy()
  1156. end
  1157. end
  1158. local deathsTable = sortTable(tab2[1])
  1159. for i, c in pairs(deathsTable) do
  1160. local newName = script.Player1:Clone()
  1161. newName.Text = "#" .. count .. ". " .. c.playerName .. ": " .. c.Val .. " Deaths"
  1162. if c.playerName == Player.Name then
  1163. newName.BackgroundColor3 = Color3.fromRGB(36, 89, 117)
  1164. end
  1165. newName.Parent = tab1[1]
  1166. count = count + 1
  1167. end
  1168. count = 1
  1169. for i, c in pairs(tab1[2]:GetChildren()) do
  1170. if c.ClassName == "TextLabel" then
  1171. c:Destroy()
  1172. end
  1173. end
  1174. local winsTable = sortTable(tab2[2])
  1175. for i, c in pairs(winsTable) do
  1176. local newName = script.Player1:Clone()
  1177. newName.Text = "#" .. count .. ". " .. c.playerName .. ": " .. c.Val .. " Wins"
  1178. if c.playerName == Player.Name then
  1179. newName.BackgroundColor3 = Color3.fromRGB(36, 89, 117)
  1180. end
  1181. newName.Parent = tab1[2]
  1182. count = count + 1
  1183. end
  1184. count = 1
  1185. for i, c in pairs(tab1[3]:GetChildren()) do
  1186. if c.ClassName == "TextLabel" then
  1187. c:Destroy()
  1188. end
  1189. end
  1190. local killsTable = sortTable(tab2[3])
  1191. for i, c in pairs(killsTable) do
  1192. local newName = script.Player1:Clone()
  1193. newName.Text = "#" .. count .. ". " .. c.playerName .. ": " .. c.Val .. " Kills"
  1194. if c.playerName == Player.Name then
  1195. newName.BackgroundColor3 = Color3.fromRGB(36, 89, 117)
  1196. end
  1197. newName.Parent = tab1[3]
  1198. count = count + 1
  1199. end
  1200. end
  1201. local function updateLeaderboard(leaderboardType)
  1202. currentLeaderboardType = leaderboardType
  1203. if leaderboardType == 1 then
  1204. coreUI.Leaderboard.Base.Select.Deaths.Text = "Top 100 Deaths - Solo"
  1205. coreUI.Leaderboard.Base.Select.Wins.Text = "Top 100 Wins - Solo"
  1206. coreUI.Leaderboard.Base.Select.Kills.Text = "Top 100 Kills - Solo"
  1207. doThing({
  1208. coreUI.Leaderboard.Base.Info.Deaths.Holder,
  1209. coreUI.Leaderboard.Base.Info.Wins.Holder,
  1210. coreUI.Leaderboard.Base.Info.Kills.Holder
  1211. }, {
  1212. soloDeathsX,
  1213. soloWinsX,
  1214. soloKillsX
  1215. })
  1216. elseif leaderboardType == 2 then
  1217. coreUI.Leaderboard.Base.Select.Deaths.Text = "Top 100 Deaths - Duo"
  1218. coreUI.Leaderboard.Base.Select.Wins.Text = "Top 100 Wins - Duo"
  1219. coreUI.Leaderboard.Base.Select.Kills.Text = "Top 100 Kills - Duo"
  1220. doThing({
  1221. coreUI.Leaderboard.Base.Info.Deaths.Holder,
  1222. coreUI.Leaderboard.Base.Info.Wins.Holder,
  1223. coreUI.Leaderboard.Base.Info.Kills.Holder
  1224. }, {
  1225. duoDeathsX,
  1226. duoWinsX,
  1227. duoKillsX
  1228. })
  1229. elseif leaderboardType == 3 then
  1230. coreUI.Leaderboard.Base.Select.Deaths.Text = "Top 100 Deaths - Squad"
  1231. coreUI.Leaderboard.Base.Select.Wins.Text = "Top 100 Wins - Squad"
  1232. coreUI.Leaderboard.Base.Select.Kills.Text = "Top 100 Kills - Squad"
  1233. doThing({
  1234. coreUI.Leaderboard.Base.Info.Deaths.Holder,
  1235. coreUI.Leaderboard.Base.Info.Wins.Holder,
  1236. coreUI.Leaderboard.Base.Info.Kills.Holder
  1237. }, {
  1238. squadDeathsX,
  1239. squadWinsX,
  1240. squadKillsX
  1241. })
  1242. end
  1243. end
  1244. local function getLeaderboards()
  1245. if tick() - lastLeaderboardGet >= 55 then
  1246. lastLeaderboardGet = tick()
  1247. local soloDeaths, soloWins, soloKills, duoDeaths, duoWins, duoKills, squadDeaths, squadWins, squadKills = remoteFunctions.Get_Leaderboards:InvokeServer()
  1248. if soloDeaths then
  1249. soloDeathsX, soloWinsX, soloKillsX, duoDeathsX, duoWinsX, duoKillsX, squadDeathsX, squadWinsX, squadKillsX = soloDeaths, soloWins, soloKills, duoDeaths, duoWins, duoKills, squadDeaths, squadWins, squadKills
  1250. updateLeaderboard(currentLeaderboardType)
  1251. end
  1252. end
  1253. end
  1254. local function buyItem(buyType, itemID)
  1255. if buyType == 1 then
  1256. if not Player.Data.Teleporting.Value then
  1257. marketplaceService:PromptProductPurchase(Player, itemID)
  1258. end
  1259. elseif buyType == 2 then
  1260. marketplaceService:PromptGamePassPurchase(Player, itemID)
  1261. end
  1262. end
  1263. local playerClickedRecent = {}
  1264. local function inviteFriend(PlayerName, playerFriendsID)
  1265. if friends then
  1266. local c = friends[playerFriendsID]
  1267. if game.Players:FindFirstChild(PlayerName) then
  1268. remoteEvents.Request_Invite:FireServer(game.Players[PlayerName])
  1269. elseif c.LocationType == 0 or c.PlaceId ~= game.PlaceId then
  1270. if c.LocationType ~= 0 and c.PlaceId ~= 1320174999 then
  1271. _G.notify("Player not in game", Color3.new(1, 1, 1))
  1272. elseif c.LocationType ~= 0 and c.PlaceId == 1320174999 then
  1273. _G.notify("Player currently in game", Color3.new(1, 1, 1))
  1274. end
  1275. elseif c.LocationType ~= 0 and c.PlaceId == game.PlaceId then
  1276. if not playerClickedRecent[PlayerName] then
  1277. playerClickedRecent[PlayerName] = true
  1278. spawn(function()
  1279. wait(3)
  1280. playerClickedRecent[PlayerName] = nil
  1281. end)
  1282. _G.notify("Player not in same server", Color3.new(1, 1, 1))
  1283. wait()
  1284. _G.notify("Invite again to join their lobby!", Color3.new(0.25, 1, 0.25))
  1285. else
  1286. print("Attempting to follow...")
  1287. playerClickedRecent[PlayerName] = nil
  1288. local good, PlayerID = pcall(function()
  1289. return game.Players:GetUserIdFromNameAsync(PlayerName)
  1290. end)
  1291. if good and PlayerID then
  1292. local ret = remoteFunctions.Follow:InvokeServer(PlayerID)
  1293. if ret == 0 then
  1294. _G.notify("Joining Players lobby!", Color3.new(1, 1, 1))
  1295. elseif ret == 1 then
  1296. _G.notify("Player no longer in lobby", Color3.new(1, 0.25, 0.25))
  1297. elseif ret == 2 then
  1298. _G.notify("Error joining Player", Color3.new(1, 0, 0))
  1299. end
  1300. else
  1301. _G.notify("Error fetching Player ID", Color3.new(1, 0, 0))
  1302. end
  1303. end
  1304. end
  1305. elseif game.Players:FindFirstChild(PlayerName) then
  1306. remoteEvents.Request_Invite:FireServer(game.Players[PlayerName])
  1307. elseif not playerClickedRecent[PlayerName] then
  1308. playerClickedRecent[PlayerName] = true
  1309. spawn(function()
  1310. wait(3)
  1311. playerClickedRecent[PlayerName] = nil
  1312. end)
  1313. _G.notify("Player not in same server", Color3.new(1, 1, 1))
  1314. wait()
  1315. _G.notify("Invite again to join their lobby!", Color3.new(0.25, 1, 0.25))
  1316. else
  1317. print("Attempting to follow...")
  1318. playerClickedRecent[PlayerName] = nil
  1319. local good, PlayerID = pcall(function()
  1320. return game.Players:GetUserIdFromNameAsync(PlayerName)
  1321. end)
  1322. if good and PlayerID then
  1323. local ret = remoteFunctions.Follow:InvokeServer(PlayerID)
  1324. if ret == 0 then
  1325. _G.notify("Joining Players lobby!", Color3.new(1, 1, 1))
  1326. elseif ret == 1 then
  1327. _G.notify("Player no longer in lobby", Color3.new(1, 0.25, 0.25))
  1328. elseif ret == 2 then
  1329. _G.notify("Error joining Player", Color3.new(1, 0, 0))
  1330. else
  1331. _G.notify("Unknown error joining Player", Color3.new(1, 0, 0))
  1332. end
  1333. else
  1334. _G.notify("Error fetching Player ID", Color3.new(1, 0, 0))
  1335. end
  1336. end
  1337. end
  1338. local function updateStorePrices()
  1339. pcall(function()
  1340. local developerProducts = marketplaceService:GetDeveloperProductsAsync():GetCurrentPage()
  1341. local products = {}
  1342. for _, developerProduct in pairs(developerProducts) do
  1343. products[developerProduct.ProductId] = developerProduct
  1344. end
  1345. for i, c in pairs(coreUI.Store.Base.Page.Page:GetChildren()) do
  1346. pcall(function()
  1347. if products[c.ID.Value] and products[c.ID.Value].PriceInRobux then
  1348. c.Base.Cost.Text = products[c.ID.Value].PriceInRobux .. " Robux"
  1349. end
  1350. end)
  1351. end
  1352. for i, c in pairs(coreUI.Store.Base.Page2:GetChildren()) do
  1353. pcall(function()
  1354. if products[c.ID.Value] and products[c.ID.Value].PriceInRobux then
  1355. c.Base.Cost.Text = products[c.ID.Value].PriceInRobux .. " Robux"
  1356. end
  1357. end)
  1358. end
  1359. end)
  1360. end
  1361. remoteEvents.Request_Invite.OnClientEvent:connect(function(From)
  1362. local has = false
  1363. for i, c in pairs(requestQue) do
  1364. if c == From then
  1365. has = true
  1366. end
  1367. end
  1368. if not has then
  1369. table.insert(requestQue, From)
  1370. repeat
  1371. wait()
  1372. until requestQue[1] == From
  1373. invitePlayer = From
  1374. coreUI.Invite.PlayerName.Text = From.Name
  1375. coreUI.Invite.Visible = true
  1376. coreUI.Invite:TweenPosition(UDim2.new(0.02, 0, 0.45, 0), "Out", "Quart", 0.25, true)
  1377. local start = tick()
  1378. repeat
  1379. wait()
  1380. until tick() - start >= 10 or not invitePlayer
  1381. coreUI.Invite:TweenPosition(UDim2.new(-0.52, 0, 0.45, 0), "Out", "Quart", 0.25, true)
  1382. wait(0.25)
  1383. coreUI.Invite.Visible = false
  1384. if requestQue[1] == From then
  1385. table.remove(requestQue, 1)
  1386. end
  1387. invitePlayer = nil
  1388. end
  1389. end)
  1390. remoteEvents.Sent_Invite.OnClientEvent:connect(function()
  1391. _G.notify("Group invite sent!", Color3.new(1, 1, 1))
  1392. end)
  1393. remoteEvents.Full_Invite.OnClientEvent:connect(function()
  1394. _G.notify("Player already in group!", Color3.new(1, 1, 1))
  1395. end)
  1396. local function goBackPossibles()
  1397. if not doingEdit then
  1398. changePageNumber(3, 2)
  1399. else
  1400. changePageNumber(3, 10, true)
  1401. end
  1402. end
  1403. remoteEvents.Daily_Reward.OnClientEvent:connect(function(totalDays, amount)
  1404. wait(1)
  1405. coreUI.Reward.Base.Shop.Base.Days.Text = totalDays .. " Consecutive Days!"
  1406. coreUI.Reward.Base.Shop.Base.Reward.Text = "+" .. commaSeperate(amount) .. " Bucks!"
  1407. repeat
  1408. wait(0.25)
  1409. until not exclusiveOpen
  1410. toggleReward(true)
  1411. end)
  1412. game:GetService("RunService").Heartbeat:connect(function()
  1413. if Player:FindFirstChild("Data") and Player.Data.Status.Value ~= "" then
  1414. if tick() - tock >= 0.75 then
  1415. tock = tick()
  1416. coreUI.Buttons.Status.Info.Text = Player.Data.Status.Value .. string.rep(".", dotCount)
  1417. dotCount = dotCount + 1
  1418. if dotCount > 3 then
  1419. dotCount = 0
  1420. end
  1421. elseif coreUI.Buttons.Status.Info.Text == "" then
  1422. coreUI.Buttons.Status.Info.Text = Player.Data.Status.Value
  1423. end
  1424. coreUI.Buttons.Status:TweenPosition(UDim2.new(0.02, 0, -0.05, 0), "Out", "Quart", 0.25, true)
  1425. else
  1426. coreUI.Buttons.Status:TweenPosition(UDim2.new(-0.52, 0, -0.05, 0), "Out", "Quart", 0.25, true)
  1427. spawn(function()
  1428. wait(0.25)
  1429. if Player.Data.Status.Value == "" then
  1430. coreUI.Buttons.Status.Info.Text = ""
  1431. end
  1432. end)
  1433. end
  1434. if Player.Data.Waiting.Value and not Player.Data.Teleporting.Value then
  1435. coreUI.Lobby.Buttons.Count.Info.Text = game.ReplicatedStorage.Server_Data[types[Player.Data.Group.Value.Owner.Value.Data.Type.Value] .. "_Count"].Value .. " Players"
  1436. coreUI.Lobby.Buttons.Count:TweenPosition(UDim2.new(0.105, 0, 0.65, 0), "Out", "Quart", 0.25, true)
  1437. else
  1438. coreUI.Lobby.Buttons.Count:TweenPosition(UDim2.new(-0.505, 0, 0.65, 0), "Out", "Quart", 0.25, true)
  1439. end
  1440. if tick() - leaderboardSecondUpdate >= 1 then
  1441. local currentTime = os.time()
  1442. if selectedPage == 5 or selectedPage == 4 then
  1443. leaderboardSecondUpdate = tick()
  1444. local lastUpdateLeaderboard = game.ReplicatedStorage.Server_Data.Leaderboard_Update.Value
  1445. if currentTime - lastUpdateLeaderboard < 604800 then
  1446. local difference = 604800 - (currentTime - lastUpdateLeaderboard)
  1447. local days = "0"
  1448. local hours = "00"
  1449. local minutes = "00"
  1450. local seconds = "00"
  1451. if 0 < difference / 60 / 60 then
  1452. local hoursX = math.floor(difference / 60 / 60)
  1453. local daysX = math.floor(hoursX / 24)
  1454. if daysX > 0 then
  1455. days = tostring(daysX)
  1456. difference = difference - daysX * 24 * 60 * 60
  1457. end
  1458. local hoursX = math.floor(difference / 60 / 60)
  1459. if hoursX >= 10 then
  1460. hours = tostring(hoursX)
  1461. else
  1462. hours = "0" .. hoursX
  1463. end
  1464. difference = difference - hoursX * 60 * 60
  1465. end
  1466. if 0 < difference / 60 then
  1467. local minutesX = math.floor(difference / 60)
  1468. if minutesX >= 10 then
  1469. minutes = tostring(minutesX)
  1470. else
  1471. minutes = "0" .. minutesX
  1472. end
  1473. difference = difference - minutesX * 60
  1474. end
  1475. if difference > 0 then
  1476. local secondsX = math.floor(difference)
  1477. if secondsX >= 10 then
  1478. seconds = tostring(secondsX)
  1479. else
  1480. seconds = "0" .. secondsX
  1481. end
  1482. end
  1483. coreUI.Leaderboard.Base.Top.Timer.Text = "Resets in: " .. days .. ":" .. hours .. ":" .. minutes .. ":" .. seconds
  1484. coreUI.Stats.Base.Top.Top.Reset.Text = "Weekly reset in: " .. days .. ":" .. hours .. ":" .. minutes .. ":" .. seconds
  1485. else
  1486. coreUI.Leaderboard.Base.Top.Timer.Text = "Resetting soon..."
  1487. coreUI.Stats.Base.Top.Top.Reset.Text = "Resetting soon..."
  1488. end
  1489. end
  1490. if exclusiveOpen or selectedPage == 1 then
  1491. local lastUpdateStarterPack = playerData.Exclusive.Value
  1492. if currentTime - lastUpdateStarterPack < 172800 and not playerData.Exclusive_Purchased.Value then
  1493. local difference = 172800 - (currentTime - lastUpdateStarterPack)
  1494. local hours = "00"
  1495. local minutes = "00"
  1496. local seconds = "00"
  1497. if 0 < difference / 60 / 60 then
  1498. local hoursX = math.floor(difference / 60 / 60)
  1499. local hoursX = math.floor(difference / 60 / 60)
  1500. if hoursX >= 10 then
  1501. hours = tostring(hoursX)
  1502. else
  1503. hours = "0" .. hoursX
  1504. end
  1505. difference = difference - hoursX * 60 * 60
  1506. end
  1507. if 0 < difference / 60 then
  1508. local minutesX = math.floor(difference / 60)
  1509. if minutesX >= 10 then
  1510. minutes = tostring(minutesX)
  1511. else
  1512. minutes = "0" .. minutesX
  1513. end
  1514. difference = difference - minutesX * 60
  1515. end
  1516. if difference > 0 then
  1517. local secondsX = math.floor(difference)
  1518. if secondsX >= 10 then
  1519. seconds = tostring(secondsX)
  1520. else
  1521. seconds = "0" .. secondsX
  1522. end
  1523. end
  1524. coreUI.Lobby.Buttons.Exclusive.Visible = true
  1525. coreUI.Lobby.Buttons.Exclusive.Text = "EXCLUSIVE! " .. hours .. ":" .. minutes .. ":" .. seconds
  1526. coreUI.Exclusive.Base.Top.Top.Timer.Text = hours .. ":" .. minutes .. ":" .. seconds
  1527. else
  1528. coreUI.Lobby.Buttons.Exclusive.Visible = false
  1529. toggleExclusive(true, false)
  1530. end
  1531. end
  1532. end
  1533. coreUI.Buttons.Cash.Count.Text = commaSeperate(playerData.Credits.Value)
  1534. if selectedPage == 1 then
  1535. coreUI.Lobby.Level.Level.Text = "Level " .. playerData.Player_Level.Value
  1536. coreUI.Lobby.Level.Total.Text = playerData.Player_XP.Value .. "|" .. (playerData.Player_Level.Value * 10) ^ 2
  1537. local percent = playerData.Player_XP.Value / (playerData.Player_Level.Value * 10) ^ 2
  1538. if percent > 1 then
  1539. percent = 1
  1540. end
  1541. coreUI.Lobby.Level.Bar.Inner.Size = UDim2.new(percent, 0, 1, 0)
  1542. if Player.Data.Group.Value and Player.Data.Group.Value:FindFirstChild("Owner") and Player.Data.Group.Value.Owner.Value ~= Player or Player.Data.Group.Value.Name ~= Player.Name or 1 < #Player.Data.Group.Value:GetChildren() then
  1543. coreUI.Lobby.Buttons.LeaveGroup:TweenPosition(UDim2.new(0.9, 0, 0.65, 0), "Out", "Quart", 0.25, true)
  1544. else
  1545. coreUI.Lobby.Buttons.LeaveGroup:TweenPosition(UDim2.new(1.25, 0, 0.65, 0), "Out", "Quart", 0.25, true)
  1546. end
  1547. if Player.Data.Group.Value and Player.Data.Group.Value:FindFirstChild("Owner") and Player.Data.Group.Value.Owner.Value then
  1548. local Player = Player.Data.Group.Value.Owner.Value
  1549. if Player.Data.Fill.Value then
  1550. coreUI.Lobby.Matching.FillButton.Text = "Fill"
  1551. else
  1552. coreUI.Lobby.Matching.FillButton.Text = "No Fill"
  1553. end
  1554. coreUI.Lobby.Matching.TypeButton.Text = types[Player.Data.Type.Value]
  1555. end
  1556. if Player.Data.Ready.Value then
  1557. coreUI.Lobby.Matching.Play.Text = "Not Ready"
  1558. else
  1559. coreUI.Lobby.Matching.Play.Text = "Ready"
  1560. end
  1561. if Player.Data.Ready.Value then
  1562. workspace.Characters[Player.Name].Head.Info.Ready.Text = "Ready"
  1563. workspace.Characters[Player.Name].Head.Info.Ready.TextColor3 = Color3.new(0.25, 1, 0.25)
  1564. else
  1565. workspace.Characters[Player.Name].Head.Info.Ready.Text = "Not Ready"
  1566. workspace.Characters[Player.Name].Head.Info.Ready.TextColor3 = Color3.new(1, 0.125, 0.125)
  1567. end
  1568. if game.ReplicatedStorage.Player_Data:FindFirstChild(Player.Name) then
  1569. workspace.Characters[Player.Name].Head.Info.Level.Text = "Level " .. game.ReplicatedStorage.Player_Data[Player.Name].Player_Level.Value
  1570. end
  1571. for i, c in pairs(workspace.Characters:GetChildren()) do
  1572. if c:FindFirstChild("Head") then
  1573. c.Head.Info.Enabled = true
  1574. end
  1575. end
  1576. else
  1577. for i, c in pairs(workspace.Characters:GetChildren()) do
  1578. if c:FindFirstChild("Head") then
  1579. c.Head.Info.Enabled = false
  1580. end
  1581. end
  1582. end
  1583. end)
  1584. game:GetService("RunService").Stepped:connect(function()
  1585. if tick() - tpDataTick >= 1 and Player.Data.Ready.Value and Player.Data.Waiting.Value and Player.Data.Group.Value then
  1586. local playerIds = {}
  1587. for i, c in pairs(Player.Data.Group.Value:GetChildren()) do
  1588. if c and c.Value then
  1589. table.insert(playerIds, c.Value.UserId)
  1590. end
  1591. end
  1592. tpService:SetTeleportSetting("Group_IDs", playerIds)
  1593. end
  1594. local ii = 1
  1595. for i = 1, 4 do
  1596. if Player.Data.Group.Value and not Player.Data.Group.Value:GetChildren()[i] then
  1597. if coreUI.Invites:FindFirstChild("Invite_" .. ii) then
  1598. local obj = coreUI.Invites["Invite_" .. ii]
  1599. local pos = Camera:WorldToViewportPoint(workspace["Spot" .. ii].Position + Vector3.new(0, 7, 0))
  1600. obj.Position = UDim2.new(0, pos.x, 0, pos.y)
  1601. if not obj.Visible then
  1602. for iii, cc in pairs(workspace.Characters:GetChildren()) do
  1603. if cc:FindFirstChild("ID:" .. ii) then
  1604. cc:Destroy()
  1605. end
  1606. end
  1607. end
  1608. if selectedPage == 1 then
  1609. obj.Visible = true
  1610. else
  1611. obj.Visible = false
  1612. end
  1613. ii = ii + 1
  1614. end
  1615. elseif Player.Data.Group.Value and Player.Data.Group.Value:GetChildren()[i] then
  1616. if Player.Data.Group.Value:GetChildren()[i].Value ~= Player and coreUI.Invites:FindFirstChild("Invite_" .. ii) then
  1617. local obj = coreUI.Invites["Invite_" .. ii]
  1618. if not workspace.Characters:FindFirstChild(Player.Data.Group.Value:GetChildren()[i].Value.Name) then
  1619. local playerModel = script[ii]:Clone()
  1620. playerModel.Name = Player.Data.Group.Value:GetChildren()[i].Value.Name
  1621. playerModel.Head.Info.Username.Text = playerModel.Name
  1622. local id = Instance.new("BoolValue")
  1623. id.Name = "ID:" .. ii
  1624. id.Parent = playerModel
  1625. playerModel.Parent = workspace.Characters
  1626. end
  1627. obj.Visible = false
  1628. ii = ii + 1
  1629. end
  1630. local Player = Player.Data.Group.Value:GetChildren()[i].Value
  1631. if workspace.Characters:FindFirstChild(Player.Name) then
  1632. if Player.Data.Ready.Value then
  1633. workspace.Characters[Player.Name].Head.Info.Ready.Text = "Ready"
  1634. workspace.Characters[Player.Name].Head.Info.Ready.TextColor3 = Color3.new(0.25, 1, 0.25)
  1635. else
  1636. workspace.Characters[Player.Name].Head.Info.Ready.Text = "Not Ready"
  1637. workspace.Characters[Player.Name].Head.Info.Ready.TextColor3 = Color3.new(1, 0.125, 0.125)
  1638. end
  1639. if game.ReplicatedStorage.Player_Data:FindFirstChild(Player.Name) then
  1640. workspace.Characters[Player.Name].Head.Info.Level.Text = "Level " .. game.ReplicatedStorage.Player_Data[Player.Name].Player_Level.Value
  1641. end
  1642. end
  1643. end
  1644. end
  1645. if tick() - friendsRefresh >= 4 then
  1646. onlineFriends = 0
  1647. friendsRefresh = tick()
  1648. if not pcall(function()
  1649. friends = game.Players.LocalPlayer:GetFriendsOnline(200)
  1650. end) then
  1651. friends = nil
  1652. warn("Friends list fetch failed!")
  1653. counter = counter + 1
  1654. if counter % 8 == 0 then
  1655. _G.notify("Friends list currently unavailable.", Color3.new(1, 0.125, 0.125))
  1656. end
  1657. for i, c in pairs(coreUI.Friends.Holder:GetChildren()) do
  1658. if c.ClassName == "TextButton" then
  1659. c:Destroy()
  1660. end
  1661. end
  1662. for i, c in pairs(game.Players:GetChildren()) do
  1663. if c and c ~= Player and c:IsFriendsWith(Player.UserId) then
  1664. local newFriend = script.Friend:Clone()
  1665. newFriend.PlayerName.Text = c.Name
  1666. newFriend.Parent = coreUI.Friends.Holder
  1667. buttonModule.handleButton(newFriend.Invite, inviteFriend, {
  1668. c.Name,
  1669. i
  1670. })
  1671. end
  1672. end
  1673. else
  1674. for i, c in pairs(coreUI.Friends.Holder:GetChildren()) do
  1675. if c.ClassName == "TextButton" then
  1676. c:Destroy()
  1677. end
  1678. end
  1679. for i, c in pairs(friends) do
  1680. if c then
  1681. local newFriend = script.Friend:Clone()
  1682. newFriend.PlayerName.Text = c.UserName
  1683. if not game.Players:FindFirstChild(c.UserName) then
  1684. if c.LocationType == 0 or c.PlaceId ~= game.PlaceId then
  1685. if c.LocationType ~= 0 and c.PlaceId ~= 1320174999 then
  1686. newFriend.Icon.Image = "rbxassetid://1102807089"
  1687. elseif c.LocationType ~= 0 and c.PlaceId == 1320174999 then
  1688. newFriend.Icon.Image = "rbxassetid://1215289314"
  1689. end
  1690. elseif c.LocationType ~= 0 and c.PlaceId == game.PlaceId then
  1691. onlineFriends = onlineFriends + 1
  1692. end
  1693. else
  1694. onlineFriends = onlineFriends + 1
  1695. end
  1696. newFriend.Parent = coreUI.Friends.Holder
  1697. buttonModule.handleButton(newFriend.Invite, inviteFriend, {
  1698. c.UserName,
  1699. i
  1700. })
  1701. end
  1702. end
  1703. end
  1704. if (onlineFriends > lastFriendCount or onlineFriends < lastFriendCount) and onlineFriends >= 1 then
  1705. spawn(function()
  1706. coreUI.Buttons.Group:TweenSizeAndPosition(UDim2.new(0.06, 0, 0.6, 0), UDim2.new(0.955, 0, 0.1, 0), "Out", "Quart", 0.225, true)
  1707. wait(0.225)
  1708. coreUI.Buttons.Group:TweenSizeAndPosition(UDim2.new(0.06, 0, 0.6, 0), UDim2.new(0.955, 0, 0.25, 0), "Out", "Quart", 0.225, true)
  1709. wait(0.225)
  1710. coreUI.Buttons.Group:TweenSizeAndPosition(UDim2.new(0.06, 0, 0.6, 0), UDim2.new(0.955, 0, 0.1, 0), "Out", "Quart", 0.225, true)
  1711. wait(0.225)
  1712. coreUI.Buttons.Group:TweenSizeAndPosition(UDim2.new(0.06, 0, 0.6, 0), UDim2.new(0.955, 0, 0.25, 0), "Out", "Quart", 0.225, true)
  1713. end)
  1714. end
  1715. lastFriendCount = onlineFriends
  1716. getLeaderboards()
  1717. updateStorePrices()
  1718. end
  1719. coreUI.Buttons.Group.Count.Text = onlineFriends
  1720. end)
  1721. local recentInvites = 0
  1722. coreUI.Friends.Type.Box.FocusLost:connect(function(PressedEnter)
  1723. if PressedEnter and string.len(coreUI.Friends.Type.Box.Text) > 0 and recentInvites <= 2 then
  1724. if game.Players:FindFirstChild(coreUI.Friends.Type.Box.Text) then
  1725. if coreUI.Friends.Type.Box.Text ~= Player.Name then
  1726. remoteEvents.Request_Invite:FireServer(game.Players[coreUI.Friends.Type.Box.Text])
  1727. else
  1728. _G.notify("Cannot invite self", Color3.new(1, 1, 1))
  1729. end
  1730. else
  1731. _G.notify("Player not in server", Color3.new(1, 1, 1))
  1732. end
  1733. recentInvites = recentInvites + 1
  1734. coreUI.Friends.Type.Box.Text = "Enter Username"
  1735. coreUI.Friends.Type.Box:ReleaseFocus()
  1736. _G.chatOpen = false
  1737. else
  1738. coreUI.Friends.Type.Box.Text = "Enter Username"
  1739. coreUI.Friends.Type.Box:ReleaseFocus()
  1740. _G.chatOpen = false
  1741. end
  1742. wait(1)
  1743. recentInvites = recentInvites - 1
  1744. end)
  1745. local lastChange = tick()
  1746. local function changeInvite()
  1747. if tick() - lastChange >= 0.25 then
  1748. lastChange = tick()
  1749. remoteEvents.Change_Invite:FireServer()
  1750. end
  1751. end
  1752. local inviteOptions = {
  1753. "Allowing All Invites",
  1754. "Allowing Friend Invites",
  1755. "Allowing NO Invites"
  1756. }
  1757. playerData.Invite_Option.Changed:connect(function()
  1758. coreUI.Lobby.Bottom.AcceptInvites.Text = inviteOptions[playerData.Invite_Option.Value + 1]
  1759. end)
  1760. coreUI.Lobby.Bottom.AcceptInvites.Text = inviteOptions[playerData.Invite_Option.Value + 1]
  1761. swapPage(1)
  1762. updateStorePrices()
  1763. local currentTime = os.time()
  1764. local lastUpdateStarterPack = playerData.Exclusive.Value
  1765. if currentTime - lastUpdateStarterPack < 172800 and not playerData.Exclusive_Purchased.Value then
  1766. coreUI.Lobby.Buttons.Exclusive.Visible = true
  1767. toggleExclusive(true, true)
  1768. else
  1769. coreUI.Lobby.Buttons.Exclusive.Visible = false
  1770. end
  1771. playerData.Exclusive_Purchased.Changed:connect(function()
  1772. if playerData.Exclusive_Purchased.Value then
  1773. script.Chest_Open:Play()
  1774. end
  1775. end)
  1776. local lastCredits = playerData.Credits.Value
  1777. playerData.Credits.Changed:connect(function()
  1778. if playerData.Credits.Value > lastCredits then
  1779. coreUI.Buttons.Cash:TweenSizeAndPosition(UDim2.new(0.105, 0, 0.65, 0), UDim2.new(0.87, 0, 0.2, 0), "Out", "Quart", 0.175, true)
  1780. wait(0.175)
  1781. coreUI.Buttons.Cash:TweenSizeAndPosition(UDim2.new(0.1, 0, 0.6, 0), UDim2.new(0.87, 0, 0.25, 0), "Out", "Quart", 0.175, true)
  1782. wait(0.175)
  1783. coreUI.Buttons.Cash:TweenSizeAndPosition(UDim2.new(0.105, 0, 0.65, 0), UDim2.new(0.87, 0, 0.2, 0), "Out", "Quart", 0.175, true)
  1784. wait(0.175)
  1785. coreUI.Buttons.Cash:TweenSizeAndPosition(UDim2.new(0.1, 0, 0.6, 0), UDim2.new(0.87, 0, 0.25, 0), "Out", "Quart", 0.175, true)
  1786. end
  1787. lastCredits = playerData.Credits.Value
  1788. end)
  1789. buttonModule.handleButton(coreUI.Lobby.Bottom.AcceptInvites, changeInvite)
  1790. buttonModule.handleButton(coreUI.Edit.Base.Base.Cash, shopToStore, {true})
  1791. buttonModule.handleButton(coreUI.Edit.Base.Base.Purchase, doEditPurchase)
  1792. buttonModule.handleButton(coreUI.Locker.Base.Base.Edit, toggleEdit, {true})
  1793. buttonModule.handleButton(coreUI.Edit.Base.Top.Back, toggleEdit, {false})
  1794. buttonModule.handleButton(coreUI.Edit.Base.Base.Color, swapToEquip, {"Hair Color", "Hair Color"})
  1795. buttonModule.handleButton(coreUI.Edit.Base.Base.Hair, swapToEquip, {"Hair", "Hair"})
  1796. buttonModule.handleButton(coreUI.Edit.Base.Base.Skin, swapToEquip, {"Skin Color", "Skin Color"})
  1797. buttonModule.handleButton(coreUI.Lobby.Bottom.News, changePageNumber, {3, 11})
  1798. buttonModule.handleButton(coreUI.Lobby.Bottom.Keybinds, changePageNumber, {3, 12})
  1799. buttonModule.handleButton(coreUI.Lobby.Buttons.Exclusive, toggleExclusive)
  1800. buttonModule.handleButton(coreUI.Exclusive.Base.Top.Close, toggleExclusive, {true, false})
  1801. buttonModule.handleButton(coreUI.Exclusive.Base.Shop.Base.Buy, purchaseExclusive)
  1802. buttonModule.handleButton(coreUI.Reward.Base.Top.Close, toggleReward, {false})
  1803. buttonModule.handleButton(coreUI.ItemShop.Base.Shop.Base.Cash, shopToStore, {true})
  1804. buttonModule.handleButton(coreUI.ItemShop.Base.Shop.Base.Passes, shopToStore, {false})
  1805. buttonModule.handleButton(coreUI.ItemShop.Base.Shop.Base.Twitter, changePageNumber, {3, 7})
  1806. buttonModule.handleButton(coreUI.Store.Base.Top.Bucks, swapStorePage, {true})
  1807. buttonModule.handleButton(coreUI.Store.Base.Top.Passes, swapStorePage, {false})
  1808. buttonModule.handleButton(coreUI.Locker.Base.Base.Cash, shopToStore, {true})
  1809. buttonModule.handleButton(coreUI.Locker.Base.Base.Passes, shopToStore, {false})
  1810. buttonModule.handleButton(coreUI.Locker.Base.Base.Twitter, changePageNumber, {3, 7})
  1811. buttonModule.handleButton(coreUI.Codes.Base.Holder.Redeem, redeemCode)
  1812. buttonModule.handleButton(startMatching, doMatching)
  1813. buttonModule.handleButton(toggleFill, doFillToggle)
  1814. buttonModule.handleButton(toggleType, doTypeToggle)
  1815. buttonModule.handleButton(coreUI.Invites.Invite_1, openInvite)
  1816. buttonModule.handleButton(coreUI.Invites.Invite_2, openInvite)
  1817. buttonModule.handleButton(coreUI.Invites.Invite_3, openInvite)
  1818. buttonModule.handleButton(coreUI.Invite.Accept, acceptInvite)
  1819. buttonModule.handleButton(coreUI.Invite.Decline, declineInvite)
  1820. buttonModule.handleButton(coreUI.Lobby.Buttons.LeaveGroup, leaveGroup)
  1821. buttonModule.handleButton(coreUI.Buttons.Lobby, changePageNumber, {3, 1})
  1822. buttonModule.handleButton(coreUI.Buttons.Locker, changePageNumber, {3, 2})
  1823. buttonModule.handleButton(coreUI.Buttons.ItemShop, changePageNumber, {3, 3})
  1824. buttonModule.handleButton(coreUI.Buttons.Stats, changePageNumber, {3, 4})
  1825. buttonModule.handleButton(coreUI.Buttons.Leaderboard, changePageNumber, {3, 5})
  1826. buttonModule.handleButton(coreUI.Buttons.Store, changePageNumber, {3, 6})
  1827. buttonModule.handleButton(coreUI.Buttons.Codes, changePageNumber, {3, 7})
  1828. buttonModule.handleButton(coreUI.Inventory.Base.Top.Back, goBackPossibles)
  1829. buttonModule.handleButton(coreUI.Possibles.Base.Top.Back, changePageNumber, {3, 3})
  1830. buttonModule.handleButton(coreUI.Buttons.Cash, shopToStore, {true})
  1831. buttonModule.handleButton(coreUI.Buttons.Group, openInvite)
  1832. buttonModule.handleButton(coreUI.Leaderboard.Base.Top.Solo, updateLeaderboard, {1})
  1833. buttonModule.handleButton(coreUI.Leaderboard.Base.Top.Duo, updateLeaderboard, {2})
  1834. buttonModule.handleButton(coreUI.Leaderboard.Base.Top.Squad, updateLeaderboard, {3})
  1835. for i, c in pairs(coreUI.Store.Base.Page.Page:GetChildren()) do
  1836. if c.ClassName == "ImageButton" then
  1837. buttonModule.handleButton(c, buyItem, {
  1838. 1,
  1839. c:WaitForChild("ID").Value
  1840. })
  1841. end
  1842. end
  1843. for i, c in pairs(coreUI.Store.Base.Page2:GetChildren()) do
  1844. if c.ClassName == "ImageButton" then
  1845. buttonModule.handleButton(c, buyItem, {
  1846. 2,
  1847. c:WaitForChild("ID").Value
  1848. })
  1849. end
  1850. end
  1851. for i, c in pairs(coreUI.ItemShop.Base.Shop.Base:GetChildren()) do
  1852. if c.ClassName == "ImageButton" then
  1853. if string.find(c.Name, "Chest") then
  1854. buttonModule.handleButton(c, buyChestShop, {
  1855. c.Name
  1856. })
  1857. buttonModule.handleButton(c.Info, swapToPossibles, {
  1858. c.Name
  1859. })
  1860. else
  1861. buttonModule.handleButton(c, buyItemShop, {
  1862. c:WaitForChild("ItemName").Value,
  1863. c:WaitForChild("Category").Value
  1864. })
  1865. end
  1866. end
  1867. end
  1868. for i, c in pairs(coreUI.Locker.Base.Base:GetChildren()) do
  1869. if c.Name == "Glider" or c.Name == "Clothing" or c.Name == "Hat" or c.Name == "Tool" or c.Name == "Face" or c.Name == "Win Effect" or c.Name == "Death Effect" or c.Name == "Dive Trail" or c.Name == "Bullet Trail" or c.Name == "Emote" then
  1870. local useName = c.Name
  1871. if c.Name == "Win Effect" or c.Name == "Death Effect" then
  1872. useName = "Effect"
  1873. elseif c.Name == "Dive Trail" or c.Name == "Bullet Trail" then
  1874. useName = "Trail"
  1875. end
  1876. buttonModule.handleButton(c, swapToEquip, {
  1877. useName,
  1878. c.Name
  1879. })
  1880. end
  1881. end
  1882. coreUI.Loading:TweenSizeAndPosition(UDim2.new(1, 0, 0, 0), UDim2.new(0.5, 0, 0.5, 0), "Out", "Quart", 0.25, true)
  1883. wait(0.25)
  1884. coreUI.Loading.Visible = false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement