Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 72.73 KB | None | 0 0
  1. --SynapseX Decompiler
  2. return function()
  3. print("RUNNING MODULE")
  4. local expNeeded = function(l)
  5. return 41 + math.ceil(l ^ 1.95 + l * 8)
  6. end
  7. _G.Cooldowns = {}
  8. function _G.isBusy()
  9. for i, v in next, _G.Cooldowns, nil do
  10. if v[3] == true then
  11. return true
  12. end
  13. end
  14. end
  15. _G.Blocking = false
  16. _G.KO = 0
  17. function _G.isKO()
  18. return _G.KO > 0 or _G.PlayersData[game.Players.LocalPlayer].Stunned
  19. end
  20. _G.ClientsData = {}
  21. _G.PlayersData = {}
  22. _G.BlockedMoves = {}
  23. local robuxshop = {
  24. D1 = {
  25. Name = "",
  26. Description = "",
  27. ProductId = 47584996
  28. },
  29. D2 = {
  30. Name = "",
  31. Description = "",
  32. ProductId = 47585001
  33. },
  34. D3 = {
  35. Name = "",
  36. Description = "",
  37. ProductId = 47585008
  38. },
  39. D4 = {
  40. Name = "",
  41. Description = "",
  42. ProductId = 47585476
  43. },
  44. S1 = {
  45. Name = "",
  46. Description = "",
  47. ProductId = 47585486
  48. },
  49. S2 = {
  50. Name = "",
  51. Description = "",
  52. ProductId = 47585498
  53. },
  54. S3 = {
  55. Name = "",
  56. Description = "",
  57. ProductId = 47585565
  58. },
  59. S4 = {
  60. Name = "",
  61. Description = "",
  62. ProductId = 47585574
  63. },
  64. RainDrop = {
  65. Name = "Drops Rain",
  66. Description = "Everyone will watch as tons of diamonds and shards fall from the sky! Find them in the drop zone and share them with friends!",
  67. ProductId = 47585712
  68. },
  69. ResetPoints = {
  70. Name = "Refund Stat Points",
  71. Description = "Want to change your stat selection? Use this to get a refund on your stat points to remake your selection.",
  72. ProductId = 47585735
  73. },
  74. Vip = {
  75. Name = "VIP",
  76. Description = [[
  77. +1.5x shard drop value when you pick them up
  78. +1.5x EXP multiplier for using magic
  79. +An exclusive yellow chat color for VIP members only
  80. +Shard tracker - every time a shard spawns on the map, a ray from coming from the sky will show its location for 3 seconds!
  81. +Get 1 bonus shard every time someone else picks one up
  82. ]],
  83. PassId = 603389312
  84. },
  85. Premium = {
  86. Name = "Premium",
  87. Description = [[
  88. +Pick up diamonds for 2x their value!
  89. +2x EXP (stacks, 3x if you own VIP)
  90. +An exclusive red chat color for Premium members only
  91. +Diamond tracker - every time a diamond spawns on the map, a ray coming from the sky will show its location for 3 seconds!
  92. +2x shards value (stacks, 3x if you own vip, only if you pick them up)
  93. +Get 2 shards every time someone else picks up one(stacks, 3 if you own vip)
  94. +Lower ultimate cool down when you spawn]],
  95. PassId = 604671045
  96. },
  97. Heaven = {
  98. Name = "Exclusive Map",
  99. Description = "Get access to a game pass only map with a higher shard and diamond drop rate!",
  100. PassId = 604668911
  101. },
  102. Aura = {
  103. Name = "White Aura",
  104. Description = "This game pass will grant you a white cosmetic aura that you can show off to your friends!",
  105. PassId = 738905856
  106. }
  107. }
  108. local CAMERA = workspace.CurrentCamera
  109. local STORAGE = game:GetService("ReplicatedStorage")
  110. local MAGICS = require(STORAGE:WaitForChild("Magics"))
  111. local TYPE_IMAGES = require(STORAGE.Magics:WaitForChild("TypeImages"))
  112. local Enums = require(STORAGE.Magics:WaitForChild("Enums"))
  113. _G.MAGICS = MAGICS
  114. STORAGE:WaitForChild("Magics"):Destroy()
  115. local StarterGui = game:GetService("StarterGui")
  116. StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
  117. local player = game.Players.LocalPlayer
  118. local character = player.Character or player.CharacterAdded:Wait()
  119. local humanoid = character:WaitForChild("Humanoid")
  120. local hrp = character:WaitForChild("HumanoidRootPart")
  121. local UIS = game:GetService("UserInputService")
  122. local REMOTES = STORAGE:WaitForChild("Remotes")
  123. player.CharacterAdded:connect(function(c)
  124. _G.running = false
  125. character = c
  126. humanoid = c:WaitForChild("Humanoid")
  127. hrp = c:WaitForChild("HumanoidRootPart")
  128. hrp.Touched:connect(touchy)
  129. _G.Cooldowns = {}
  130. _G.BlockedMoves = {}
  131. _G.KO = 0
  132. for i, v in next, MAGICS, nil do
  133. for i2, v2 in next, v.Attacks, nil do
  134. _G.Cooldowns[v2.Type] = {
  135. v2.MagicType,
  136. v2.Name,
  137. false
  138. }
  139. if v2.Type == Enums.MoveType.Ultimate then
  140. _G.BlockedMoves[v2.Type] = true
  141. end
  142. end
  143. end
  144. end)
  145. _G.safezoned = true
  146. local safezones = {}
  147. for i, v in next, workspace:WaitForChild("Map"):WaitForChild("SafeZones"):GetChildren() do
  148. safezones[#safezones + 1] = {
  149. pos = v.Position,
  150. radius = v.Mesh.Scale.x / 2
  151. }
  152. end
  153. print("SAFEZONES")
  154. local holding = false
  155. local mouse = player:GetMouse()
  156. local ign = workspace:WaitForChild(".Ignore")
  157. mouse.TargetFilter = ign
  158. local GUI = player:WaitForChild("PlayerGui")
  159. local MAIN_GUI = GUI:WaitForChild("Main")
  160. local reqM2 = MAIN_GUI:WaitForChild("RequiredBar")
  161. reqM2.Name = "RequiredStamina"
  162. local reqM = MAIN_GUI:WaitForChild("RequiredStamina"):Clone()
  163. reqM.Name = "RequiredMana"
  164. reqM.Parent = MAIN_GUI:WaitForChild("SkillsBar"):WaitForChild("Energy")
  165. local hb = MAIN_GUI.SkillsBar.Health
  166. local eb = MAIN_GUI.SkillsBar.Energy
  167. local sb = MAIN_GUI.SkillsBar.Stamina
  168. local exp = MAIN_GUI.Frame1.Experience
  169. local lvl = MAIN_GUI.Frame1.Level.TextLabel
  170. local shards = MAIN_GUI.Frame1.Shards
  171. local diamonds = MAIN_GUI.Frame1.Diamonds
  172. local shopTable = {}
  173. for _, v in pairs(MAIN_GUI:WaitForChild("Shop").GamepassesContainer:GetChildren()) do
  174. table.insert(shopTable, v)
  175. end
  176. for _, v in pairs(MAIN_GUI:WaitForChild("Shop").ProductsContainer:GetChildren()) do
  177. table.insert(shopTable, v)
  178. end
  179. print("PASSES")
  180. local availableMoves = {}
  181. for i, v in next, MAGICS, nil do
  182. for i2, v2 in next, v.Attacks, nil do
  183. _G.Cooldowns[v2.Type] = {
  184. v2.MagicType,
  185. v2.Name,
  186. false
  187. }
  188. end
  189. end
  190. REMOTES.ClientData.OnClientEvent:connect(function(player, data)
  191. _G.ClientsData[player] = data
  192. end)
  193. REMOTES.PlayerData.OnClientEvent:connect(function(player, data)
  194. _G.PlayersData[player] = data
  195. end)
  196. REMOTES.Combat.OnClientEvent:connect(function(stun, dir)
  197. _G.KO = _G.KO + stun
  198. humanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)
  199. hrp.Velocity = dir or Vector3.new()
  200. end)
  201. local currentMoveSelected
  202. repeat
  203. wait(0)
  204. until _G.PlayersData[player]
  205. print("READY")
  206. local tutorial = _G.PlayersData[player].Data.Diamonds == 150 and _G.PlayersData[player].Data.Level == 0 and _G.PlayersData[player].Data.Exp == 0
  207. if tutorial then
  208. do
  209. local w = MAIN_GUI.Frame1.TutWindow.Next
  210. local w2 = MAIN_GUI.welcome.ImageButton
  211. w.MouseEnter:connect(function()
  212. w.ImageColor3 = Color3.new(0.85, 0.85, 0.85)
  213. end)
  214. w.MouseLeave:connect(function()
  215. w.ImageColor3 = Color3.new(1, 1, 1)
  216. end)
  217. w2.MouseEnter:connect(function()
  218. w2.ImageColor3 = Color3.new(0.85, 0.85, 0.85)
  219. end)
  220. w2.MouseLeave:connect(function()
  221. w2.ImageColor3 = Color3.new(1, 1, 1)
  222. end)
  223. end
  224. end
  225. local tuts = 0
  226. local function updateTutorial()
  227. tuts = tuts + 1
  228. local a = MAIN_GUI.Frame1.Arrow
  229. local w = MAIN_GUI.Frame1.TutWindow
  230. local t = w.TutorialText
  231. if tuts == 1 then
  232. w.Next.Image = "rbxassetid://619804494"
  233. a.Position = UDim2.new(1, 0, 0.75, 0)
  234. a.Rotation = -180
  235. w.Position = UDim2.new(0, 5, -1, 0)
  236. t.Text = "This is your Diamonds and Shards. You can spend these on new elements to fight!"
  237. w.Visible = true
  238. a.Visible = true
  239. w.Next.MouseButton1Up:wait()
  240. w.Next.Visible = false
  241. updateTutorial()
  242. elseif tuts == 2 then
  243. a.Position = UDim2.new(0.35, 0, -0.3, 0)
  244. a.Rotation = 90
  245. w.Position = UDim2.new(0, 5, -1, 0)
  246. t.Text = "This blue button is the elements shop, you can purchase your starter element here. Click it to continue."
  247. MAIN_GUI.Frame1.Book.MouseButton1Up:wait()
  248. updateTutorial()
  249. elseif tuts == 3 then
  250. w.Position = UDim2.new(0, 5, 0.5, 0)
  251. a.Visible = false
  252. t.Text = "Please choose your first element. Click purchase on one of these starter elements to continue."
  253. do
  254. local con
  255. con = MAIN_GUI.Book.InfoFrame.Changed:connect(function()
  256. if MAIN_GUI.Book.InfoFrame.Visible then
  257. con:disconnect()
  258. updateTutorial()
  259. end
  260. end)
  261. end
  262. elseif tuts == 4 then
  263. t.Text = "Great! Now purchase 2 moves for this element for 75 and 100 Shards."
  264. MAIN_GUI.Book.InfoFrame.Moves.b2.TextButton.MouseButton1Up:wait()
  265. updateTutorial()
  266. elseif tuts == 5 then
  267. t.Text = "Good job! Buy 1 more move for 100 Shards."
  268. MAIN_GUI.Book.InfoFrame.Moves.b3.TextButton.MouseButton1Up:wait()
  269. updateTutorial()
  270. elseif tuts == 6 then
  271. w.Position = UDim2.new(0, 5, -1, 0)
  272. a.Position = UDim2.new(0.1, 0, -0.3, 0)
  273. a.Visible = true
  274. t.Text = "Now, click the orange button to view your inventory and character stats."
  275. MAIN_GUI.Frame1.Character.MouseButton1Up:wait()
  276. updateTutorial()
  277. elseif tuts == 7 then
  278. w.Position = UDim2.new(0, 5, 0.6, 0)
  279. a.Visible = false
  280. w.Next.Visible = true
  281. t.Text = "On the left side of this page you can equip your new spells. On the right side you can spend your stat points."
  282. w.Next.MouseButton1Up:wait()
  283. updateTutorial()
  284. elseif tuts == 8 then
  285. w.Position = UDim2.new(0, 5, -1, 0)
  286. MAIN_GUI.SelectSlot.Position = UDim2.new(0, -400, 0, 0)
  287. currentMoveSelected = nil
  288. bindKeys()
  289. MAIN_GUI.Character.Visible = false
  290. if MAIN_GUI.Shop.Visible or MAIN_GUI.Book.Visible then
  291. MAIN_GUI.Shop.Visible = false
  292. MAIN_GUI.Book.Visible = false
  293. end
  294. if UIS.TouchEnabled then
  295. game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Chat, not MAIN_GUI.Character.Visible and not MAIN_GUI.Shop.Visible and not MAIN_GUI.Book.Visible)
  296. end
  297. t.Text = "To level up, practice using your magic. You can also defeat other players to gain more experience and shards."
  298. w.Next.MouseButton1Up:wait()
  299. updateTutorial()
  300. elseif tuts == 9 then
  301. if UIS.TouchEnabled then
  302. t.Text = "The controls are: double tap your jump button to flip and press the small gray button on the right to run."
  303. else
  304. t.Text = "There are also a few important movement controls. Double tap WASD to do flips and press Ctrl/Cmd to toggle sprint."
  305. end
  306. w.Next.MouseButton1Up:wait()
  307. updateTutorial()
  308. elseif tuts == 10 then
  309. if UIS.TouchEnabled then
  310. t.Text = "To toggle blocking, tap the small gray button on the left. However, blocking costs stamina!"
  311. else
  312. t.Text = "For your combat, you can press Q to punch and hold R to block. However, blocking costs stamina!"
  313. end
  314. w.Next.MouseButton1Up:wait()
  315. updateTutorial()
  316. elseif tuts == 11 then
  317. t.Text = "Finally, you can charge some spells by holding left click before you release to fire. That's all, have fun!"
  318. w.Next.Image = "rbxassetid://619804347"
  319. w.Next.MouseButton1Up:wait()
  320. updateTutorial()
  321. elseif tuts == 12 then
  322. w.Visible = false
  323. tutorial = false
  324. player.PlayerGui.Menu.MenuButton.Position = UDim2.new(0, 0, 0.5, 0)
  325. end
  326. end
  327. coroutine.resume(coroutine.create(function()
  328. if tutorial then
  329. player.PlayerGui.Menu.MenuButton.Position = UDim2.new(0, -1000, 0, -1000)
  330. MAIN_GUI.welcome.Visible = true
  331. MAIN_GUI.welcome.ImageButton.MouseButton1Up:wait()
  332. MAIN_GUI.welcome.Visible = false
  333. updateTutorial()
  334. else
  335. tuts = 12
  336. end
  337. end))
  338. local function findAttackByKey(key)
  339. for i, v in next, availableMoves, nil do
  340. if v.keybind == key then
  341. return v.move
  342. end
  343. end
  344. end
  345. local function createSkill(atk)
  346. local c = MAIN_GUI.Skill:Clone()
  347. c.BackgroundColor3 = MAGICS[atk.MagicType].ImageColor
  348. c.Image = TYPE_IMAGES[atk.Type]
  349. c.ImageColor3 = Color3.new(0, 0, 0)
  350. c.Visible = true
  351. return c
  352. end
  353. local keybinds = {
  354. Enum.KeyCode.One,
  355. Enum.KeyCode.Two,
  356. Enum.KeyCode.Three,
  357. Enum.KeyCode.Four,
  358. Enum.KeyCode.Five
  359. }
  360. local prevSelected = 1
  361. local selectedBind
  362. local consBind = {}
  363. function bindKeys()
  364. for i, v in next, MAIN_GUI.SkillsBar:GetChildren() do
  365. if v:FindFirstChild("N") then
  366. v:Destroy()
  367. end
  368. end
  369. for i, v in next, MAIN_GUI.Character.Backpack:GetChildren() do
  370. if v:FindFirstChild("N") then
  371. v:Destroy()
  372. end
  373. end
  374. for i, v in next, consBind, nil do
  375. v:disconnect()
  376. end
  377. local Loadout = {}
  378. for i, atk in next, availableMoves, nil do
  379. if atk.keybind then
  380. table.insert(Loadout, {
  381. Name = atk.move.Name,
  382. Keybind = atk.keybind
  383. })
  384. local c = createSkill(atk.move)
  385. c.Name = atk.keybind
  386. c.N.Text = atk.keybind
  387. c.AnchorPoint = Vector2.new(0.5, 0)
  388. c.Position = UDim2.new(-0.025 + 0.175 * atk.keybind, 0, 0.1, 0)
  389. c.Parent = MAIN_GUI.SkillsBar
  390. c.MouseButton1Up:connect(function()
  391. selectAttack(atk.keybind, Enum.UserInputState.Begin, {
  392. KeyCode = atk.keybind
  393. })
  394. end)
  395. game:GetService("ContextActionService"):BindAction(atk.keybind, selectAttack, false, keybinds[atk.keybind], Enum.KeyCode.ButtonR1, Enum.KeyCode.ButtonL1)
  396. local c2 = c:Clone()
  397. c2.LayoutOrder = atk.keybind
  398. c2.Size = UDim2.new(0.7, 0, 0.7, 0)
  399. c2.Parent = MAIN_GUI.Character.Backpack
  400. consBind[#consBind + 1] = c2.MouseButton1Up:connect(function()
  401. if UIS:GetGamepadConnected(Enum.UserInputType.Gamepad1) then
  402. print("A")
  403. game:GetService("GuiService").SelectedObject = MAIN_GUI.Frame1.Character
  404. end
  405. game:GetService("ContextActionService"):UnbindAction(atk.keybind)
  406. if selectedBind == atk.keybind then
  407. selectedBind = nil
  408. end
  409. atk.keybind = false
  410. selectAttack(atk.keybind, Enum.UserInputState.Begin)
  411. bindKeys()
  412. end)
  413. if selectedBind == atk.keybind then
  414. selectAttack(atk.keybind, Enum.UserInputState.Begin)
  415. end
  416. end
  417. end
  418. REMOTES.SendLoadout:FireServer(Loadout)
  419. end
  420. for i, v in next, MAIN_GUI:WaitForChild("SelectSlot"):WaitForChild("Grid"):GetChildren() do
  421. if v:IsA("TextButton") then
  422. v.MouseButton1Up:connect(function()
  423. if currentMoveSelected then
  424. for i, v2 in next, availableMoves, nil do
  425. if v2.keybind and v2.keybind == tonumber(v.Name) then
  426. v2.keybind = false
  427. end
  428. end
  429. currentMoveSelected.keybind = tonumber(v.Name)
  430. if UIS:GetGamepadConnected(Enum.UserInputType.Gamepad1) then
  431. game:GetService("GuiService").SelectedObject = MAIN_GUI.Frame1.Character
  432. end
  433. MAIN_GUI.SelectSlot.Position = UDim2.new(0, -1000, 0, 0)
  434. currentMoveSelected = nil
  435. bindKeys()
  436. end
  437. end)
  438. end
  439. end
  440. local consAv = {}
  441. local function updateAvailableMoves()
  442. local old = availableMoves
  443. availableMoves = {}
  444. local magicsNumber = 0
  445. for i, v in next, MAGICS, nil do
  446. magicsNumber = magicsNumber + 1
  447. end
  448. local alreadyScanned = {}
  449. for i = 1, magicsNumber do
  450. local proxy = {}
  451. for n, v in next, _G.PlayersData[player].Data.Magics, nil do
  452. if MAGICS[n] and MAGICS[n].Index == i and not alreadyScanned[n] then
  453. alreadyScanned[n] = true
  454. for i, v2 in next, MAGICS[n].Attacks, nil do
  455. if v.Unlocked >= v2.Id then
  456. local old_kb = false
  457. for i3, v3 in next, old, nil do
  458. if v3.move.Name == v2.Name then
  459. old_kb = v3.keybind
  460. end
  461. end
  462. proxy[v2.Id] = {keybind = old_kb, move = v2}
  463. end
  464. end
  465. for i, v2 in next, proxy, nil do
  466. table.insert(availableMoves, v2)
  467. end
  468. end
  469. end
  470. end
  471. for i, v in next, MAIN_GUI.Character.Available.ScrollingFrame.Frame:GetChildren() do
  472. if not v:IsA("UIComponent") then
  473. v:Destroy()
  474. end
  475. end
  476. for i, v in next, consAv, nil do
  477. v:disconnect()
  478. end
  479. local p = 0
  480. local py = 0
  481. for i, v in next, availableMoves, nil do
  482. p = p + 1
  483. if p % 6 == 0 then
  484. p = 1
  485. py = py + 1
  486. end
  487. do
  488. local c = createSkill(v.move)
  489. c.Name = v.move.Name
  490. c.N.Visible = false
  491. c.Position = UDim2.new(0, -38 + 52 * p, 0, py * 52)
  492. local asp = Instance.new("UIAspectRatioConstraint")
  493. asp.Parent = c
  494. c.Parent = MAIN_GUI.Character.Available.ScrollingFrame.Frame
  495. consAv[#consAv + 1] = c.MouseButton1Up:connect(function()
  496. MAIN_GUI.SelectSlot.Position = UDim2.new(0, mouse.X, 0, mouse.Y)
  497. if UIS:GetGamepadConnected(Enum.UserInputType.Gamepad1) then
  498. game:GetService("GuiService").SelectedObject = MAIN_GUI.SelectSlot.Grid["1"]
  499. end
  500. currentMoveSelected = v
  501. end)
  502. MAIN_GUI.Character.Available.ScrollingFrame.CanvasSize = UDim2.new(0, 0, (1 + py) * 0.333, 0)
  503. MAIN_GUI.Character.Available.ScrollingFrame.Frame.UIGridLayout.CellSize = UDim2.new(0.19, 0, 1 / (py + 1), -1)
  504. end
  505. end
  506. bindKeys()
  507. end
  508. updateAvailableMoves()
  509. local function GetIndexByName(Name)
  510. for i, atk in next, availableMoves, nil do
  511. if atk.move.Name == Name then
  512. return i
  513. end
  514. end
  515. end
  516. local Loadout = _G.PlayersData[player].Data.Loadout or {}
  517. if #Loadout == 0 then
  518. for i = 1, math.min(5, #availableMoves) do
  519. availableMoves[i].keybind = i
  520. end
  521. else
  522. for i, v in next, Loadout, nil do
  523. local Index = GetIndexByName(v.Name)
  524. if Index then
  525. availableMoves[Index].keybind = v.Keybind
  526. end
  527. end
  528. end
  529. local function updateBar()
  530. for i, v in next, availableMoves, nil do
  531. if v.keybind and MAIN_GUI.SkillsBar:FindFirstChild(v.keybind) then
  532. if _G.PlayersData[player].Stunned or _G.BlockedMoves[v.move.Type] or _G.Cooldowns[v.move.Type][3] == true then
  533. MAIN_GUI.SkillsBar[v.keybind].CD.Text = "..."
  534. end
  535. MAIN_GUI.SkillsBar[v.keybind].CD.Visible = _G.PlayersData[player].Stunned or _G.BlockedMoves[v.move.Type] or _G.Cooldowns[v.move.Type][3] and true or false
  536. end
  537. end
  538. end
  539. REMOTES.GetCooldown.OnClientEvent:connect(function(mType, mag, name, b)
  540. wait(0)
  541. local num = type(b) == "number"
  542. _G.Cooldowns[mType] = {
  543. mag,
  544. name,
  545. num and tick() or b
  546. }
  547. updateBar()
  548. end)
  549. REMOTES.GetBlock.OnClientEvent:connect(function(mType, b)
  550. wait(0)
  551. _G.BlockedMoves[mType] = b
  552. updateBar()
  553. end)
  554. function selectAttack(name, state, obj)
  555. if state == Enum.UserInputState.Begin then
  556. holding = false
  557. if obj and obj.UserInputType == Enum.UserInputType.Gamepad1 then
  558. local val = obj.KeyCode == Enum.KeyCode.ButtonR1 and 1 or -1
  559. name = tostring(prevSelected % 5 + val)
  560. if tonumber(name) <= 0 then
  561. if selectedBind == 5 then
  562. name = tostring(4)
  563. else
  564. name = tostring(5)
  565. end
  566. end
  567. prevSelected = prevSelected + val
  568. end
  569. if selectedBind == tonumber(name) then
  570. for i, v in next, availableMoves, nil do
  571. if v.keybind and MAIN_GUI.SkillsBar:FindFirstChild(v.keybind) then
  572. local g = MAIN_GUI.SkillsBar[v.keybind]
  573. selectedBind = nil
  574. g.BorderSizePixel = 0
  575. g:TweenPosition(UDim2.new(-0.025 + 0.175 * v.keybind, 0, 0.1, 0), "Out", "Quad", 0.1, true)
  576. end
  577. end
  578. return
  579. end
  580. for i, v in next, availableMoves, nil do
  581. if v.keybind then
  582. local g = MAIN_GUI.SkillsBar:FindFirstChild(v.keybind)
  583. if g then
  584. if v.keybind == tonumber(name) then
  585. selectedBind = v.keybind
  586. g:TweenPosition(UDim2.new(-0.025 + 0.175 * v.keybind, 0, 0.05, 0), "Out", "Quad", 0.1, true)
  587. g.BorderSizePixel = 2
  588. else
  589. g.BorderSizePixel = 0
  590. g:TweenPosition(UDim2.new(-0.025 + 0.175 * v.keybind, 0, 0.1, 0), "Out", "Quad", 0.1, true)
  591. end
  592. end
  593. end
  594. end
  595. end
  596. end
  597. local tooltip = MAIN_GUI.Tooltip
  598. bindKeys()
  599. mouse.Button1Up:connect(function()
  600. holding = false
  601. end)
  602. mouse.Button1Down:connect(function()
  603. holding = true
  604. if MAIN_GUI.SelectSlot.Position.X.Offset > -1000 and not collides(MAIN_GUI.SelectSlot) then
  605. currentMoveSelected = nil
  606. MAIN_GUI.SelectSlot.Position = UDim2.new(0, -1000, 0, 0)
  607. end
  608. local Magic = findAttackByKey(selectedBind)
  609. if not (not _G.PlayersData[player].Stunned and not _G.safezoned and Magic) or _G.Cooldowns[Magic.Type][3] or _G.BlockedMoves[Magic.Type] or 0 >= humanoid.Health or _G.Blocking then
  610. return
  611. end
  612. if _G.PlayersData[player].Mana < Magic.EnergyCost then
  613. local size = _G.PlayersData[player].Mana / _G.PlayersData[player].MaxMana - Magic.EnergyCost / _G.PlayersData[player].MaxMana
  614. reqM.Size = UDim2.new(size, 0, 1, 0)
  615. reqM.Position = UDim2.new(_G.PlayersData[player].Mana / _G.PlayersData[player].MaxMana - size, 0, 0, 0)
  616. reqM.BackgroundTransparency = 0
  617. return
  618. end
  619. _G.Cooldowns[Magic.Type] = {
  620. Magic.MagicType,
  621. Magic.Name,
  622. true
  623. }
  624. if Magic.Type == Enums.MoveType.Ultimate then
  625. for i = 0, 8 do
  626. if i ~= Enums.MoveType.Ultimate then
  627. _G.BlockedMoves[i] = true
  628. end
  629. end
  630. end
  631. updateBar()
  632. wait(0)
  633. Magic:ClientFunction(nil, function(data)
  634. if UIS.TouchEnabled and selectedBind then
  635. selectAttack(selectedBind, Enum.UserInputState.Begin)
  636. end
  637. return REMOTES.DoMagic:InvokeServer(Magic.MagicType, Magic.Name, data)
  638. end)
  639. end)
  640. function collides(gui)
  641. local g1p, g1s = gui.AbsolutePosition, gui.AbsoluteSize
  642. return g1p.x < mouse.X and g1p.x + g1s.x > mouse.X and g1p.y < mouse.Y and g1p.y + g1s.y > mouse.Y
  643. end
  644. local proxy = tooltip:Clone()
  645. proxy.Size = UDim2.new(0, 200, 0, 1000)
  646. proxy.Position = UDim2.new(0, -1000, 0, 0)
  647. proxy.Parent = MAIN_GUI
  648. local bp
  649. local function bPos(pos)
  650. local proxy = Instance.new("Part")
  651. proxy.Transparency = 1
  652. proxy.Anchored = false
  653. proxy.CanCollide = false
  654. proxy.Size = Vector3.new(0.2, 0.2, 0.2)
  655. local w = Instance.new("Motor6D", proxy)
  656. w.Part0 = proxy
  657. w.Part1 = hrp
  658. local bg = Instance.new("BodyPosition")
  659. bg.maxForce = Vector3.new(0, 75000, 0)
  660. bg.position = pos
  661. bg.Parent = proxy
  662. proxy.Parent = character
  663. return {
  664. aim = function(self, dir)
  665. bg.position = dir
  666. end,
  667. kill = function(self)
  668. proxy:Destroy()
  669. end
  670. }
  671. end
  672. local lastKO = 0
  673. game:GetService("RunService").RenderStepped:connect(function(dt)
  674. local newMouse = mouse.Hit.p
  675. _G.ClientsData[player] = {
  676. Mouse = newMouse,
  677. Camera = CAMERA.CFrame.p,
  678. Holding = holding
  679. }
  680. for i, v in next, availableMoves, nil do
  681. local c = _G.Cooldowns[v.move.Type]
  682. if c and v.keybind and type(c[3]) == "number" and not _G.BlockedMoves[v.move.Type] then
  683. local d = tick() - c[3]
  684. if MAGICS[c[1]].Attacks[c[2]].Cooldown - d > 0 then
  685. MAIN_GUI.SkillsBar[v.keybind].CD.Visible = true
  686. MAIN_GUI.SkillsBar[v.keybind].CD.Text = math.max(1, math.ceil(MAGICS[c[1]].Attacks[c[2]].Cooldown - d))
  687. else
  688. MAIN_GUI.SkillsBar[v.keybind].CD.Visible = false
  689. end
  690. end
  691. end
  692. updateBar()
  693. if MAIN_GUI.Book.Visible and MAIN_GUI.Book.InfoFrame.Visible then
  694. for i, v in next, MAIN_GUI.Book.InfoFrame.Moves:GetChildren() do
  695. local key, val = string.match(v.Name, "(.+)/(.+)")
  696. local mg = MAGICS[key]
  697. if mg and collides(v) then
  698. local atk = mg.Attacks[val]
  699. if atk then
  700. tooltip.Title.Text = atk.Name
  701. tooltip.Desc.Text = atk.Description
  702. proxy.Desc.Text = atk.Description
  703. local size = 30 + proxy.Desc.TextBounds.Y * 1.175
  704. tooltip.Size = UDim2.new(0, 200, 0, size)
  705. tooltip.Position = UDim2.new(0, mouse.X + 5, 0, mouse.Y - size - 5)
  706. tooltip.Visible = true
  707. break
  708. end
  709. else
  710. tooltip.Visible = false
  711. end
  712. end
  713. elseif MAIN_GUI.Shop.Visible then
  714. for i, v in next, shopTable, nil do
  715. local key = string.match(v.Name, "(.+)")
  716. local mg = robuxshop[key]
  717. if mg and mg.Name ~= "" and collides(v) then
  718. tooltip.Title.Text = mg.Name
  719. tooltip.Desc.Text = mg.Description
  720. proxy.Desc.Text = mg.Description
  721. local size = 30 + proxy.Desc.TextBounds.Y * 1.175
  722. tooltip.Size = UDim2.new(0, 250, 0, size)
  723. tooltip.Position = UDim2.new(0, mouse.X + 5, 0, mouse.Y + 5)
  724. tooltip.Visible = true
  725. break
  726. else
  727. tooltip.Visible = false
  728. end
  729. end
  730. else
  731. for i, v in next, availableMoves, nil do
  732. if v.keybind and MAIN_GUI.SkillsBar:FindFirstChild(v.keybind) and collides(MAIN_GUI.SkillsBar[v.keybind]) then
  733. local atk = v.move
  734. if atk then
  735. tooltip.Title.Text = atk.Name
  736. tooltip.Desc.Text = atk.Description
  737. proxy.Desc.Text = atk.Description
  738. local size = 30 + proxy.Desc.TextBounds.Y * 1.175
  739. tooltip.Size = UDim2.new(0, 200, 0, size)
  740. tooltip.Position = UDim2.new(0, mouse.X + 5, 0, mouse.Y - size - 5)
  741. tooltip.Visible = true
  742. break
  743. end
  744. elseif MAIN_GUI.Character.Visible and MAIN_GUI.Character.Available.ScrollingFrame.Frame:FindFirstChild(v.move.Name) and collides(MAIN_GUI.Character.Available.ScrollingFrame) and collides(MAIN_GUI.Character.Available.ScrollingFrame.Frame[v.move.Name]) then
  745. local atk = v.move
  746. if atk then
  747. tooltip.Title.Text = atk.Name
  748. tooltip.Desc.Text = atk.Description
  749. proxy.Desc.Text = atk.Description
  750. local size = 30 + proxy.Desc.TextBounds.Y * 1.175
  751. tooltip.Size = UDim2.new(0, 200, 0, size)
  752. tooltip.Position = UDim2.new(0, mouse.X + 5, 0, mouse.Y - size - 5)
  753. tooltip.Visible = true
  754. break
  755. end
  756. else
  757. tooltip.Visible = false
  758. end
  759. end
  760. end
  761. local ray = Ray.new(hrp.CFrame.p + Vector3.new(0, 3, 0), Vector3.new(0, -4, 0))
  762. local hit, pos = workspace:FindPartOnRayWithIgnoreList(ray, {
  763. character,
  764. ign[".Attacks"],
  765. ign[".Floors"],
  766. ign[".LocalEffects"],
  767. ign[".ServerEffects"]
  768. })
  769. if hit and hit.Name == ".Water" and not bp then
  770. bp = bPos(pos)
  771. elseif hit and hit.Name == ".Water" and bp then
  772. bp:aim(pos)
  773. elseif not hit and bp then
  774. bp:kill()
  775. bp = nil
  776. end
  777. if 0 < _G.KO then
  778. _G.KO = _G.KO - dt
  779. if 0 > _G.KO then
  780. _G.KO = 0
  781. humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
  782. else
  783. humanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)
  784. end
  785. end
  786. end)
  787. local create_party = MAIN_GUI:WaitForChild("CreateParty")
  788. local members_frame = MAIN_GUI:WaitForChild("MembersFrame")
  789. local invite_party = MAIN_GUI:WaitForChild("InviteParty")
  790. local invite_frame = MAIN_GUI:WaitForChild("InviteFrame")
  791. if workspace:FindFirstChild(".WavesMode") then
  792. create_party.Visible = false
  793. end
  794. local create_id = create_party.Image
  795. local invite_id = invite_party.Image
  796. local leave_id = "rbxassetid://571200296"
  797. local view_id = "rbxassetid://571200340"
  798. local copy_inv = invite_frame:WaitForChild("ScrollingFrame"):WaitForChild("Copy")
  799. local inv_lab = copy_inv:Clone()
  800. copy_inv:Destroy()
  801. local copy_mem = members_frame:WaitForChild("Frame"):WaitForChild("Copy")
  802. local mem_lab = copy_mem:Clone()
  803. copy_mem:Destroy()
  804. local bup = false
  805. local inviting = false
  806. local cur_party = ""
  807. local my_party = {}
  808. local cur_info
  809. local function upd_invites()
  810. for i, v in next, invite_frame.ScrollingFrame:GetChildren() do
  811. v:Destroy()
  812. end
  813. local ppl = game.Players:GetPlayers()
  814. invite_frame.ScrollingFrame.CanvasSize = UDim2.new(0, 0, 0, 5 + #ppl * 25)
  815. for i, v in next, ppl, nil do
  816. do
  817. local n = inv_lab:Clone()
  818. n.Position = UDim2.new(0, 5, 0, 10 + (i - 1) * 25)
  819. n.Text = v.Name
  820. if i == 1 then
  821. n.ImageButton:Destroy()
  822. else
  823. do
  824. local bup2 = false
  825. n.ImageButton.MouseButton1Up:connect(function()
  826. if bup or bup2 then
  827. return
  828. end
  829. bup = true
  830. bup2 = true
  831. n.ImageButton.Image = "rbxassetid://572347884"
  832. REMOTES.ManageParty:InvokeServer("Invite", v)
  833. bup = false
  834. wait(3)
  835. bup2 = false
  836. if n:FindFirstChild("ImageButton") then
  837. n.ImageButton.Image = "rbxassetid://571048083"
  838. end
  839. end)
  840. end
  841. end
  842. n.Parent = invite_frame.ScrollingFrame
  843. end
  844. end
  845. end
  846. local function upd_party(info)
  847. cur_info = info
  848. my_party = info or {}
  849. if info then
  850. if cur_party == "" then
  851. inviting = false
  852. invite_party.Image = invite_id
  853. members_frame.Visible = true
  854. invite_frame.Visible = false
  855. end
  856. cur_party = "InParty"
  857. create_party.Image = leave_id
  858. if info[1] == player then
  859. invite_party.Visible = true
  860. upd_invites()
  861. else
  862. invite_party.Visible = false
  863. end
  864. for i, v in next, members_frame.Frame:GetChildren() do
  865. v:Destroy()
  866. end
  867. for i, v in next, info, nil do
  868. do
  869. local n = mem_lab:Clone()
  870. n.Name = v.Name
  871. n.Position = UDim2.new(0, 5, 0, 10 + (i - 1) * 25)
  872. n.Text = v.Name
  873. if i == 1 or v == player or info[1] ~= player then
  874. n.ImageButton:Destroy()
  875. else
  876. n.ImageButton.MouseButton1Up:connect(function()
  877. if bup then
  878. return
  879. end
  880. bup = true
  881. REMOTES.ManageParty:InvokeServer("Kick", v)
  882. bup = false
  883. end)
  884. end
  885. n.Parent = members_frame.Frame
  886. end
  887. end
  888. else
  889. cur_party = ""
  890. invite_party.Image = view_id
  891. create_party.Image = create_id
  892. members_frame.Visible = false
  893. invite_frame.Visible = false
  894. invite_party.Visible = false
  895. end
  896. end
  897. create_party.MouseButton1Up:connect(function()
  898. if bup then
  899. return
  900. end
  901. bup = true
  902. local todo = cur_party
  903. if todo == "" then
  904. inviting = false
  905. todo = "Create"
  906. elseif todo == "InParty" then
  907. todo = "Leave"
  908. end
  909. local info = REMOTES.ManageParty:InvokeServer(todo)
  910. upd_party(info)
  911. bup = false
  912. end)
  913. invite_party.MouseButton1Up:connect(function()
  914. inviting = not inviting
  915. invite_party.Image = inviting and view_id or invite_id
  916. upd_party(cur_info)
  917. if inviting then
  918. members_frame.Visible = false
  919. invite_frame.Visible = true
  920. else
  921. members_frame.Visible = true
  922. invite_frame.Visible = false
  923. end
  924. end)
  925. local cur_invitation
  926. function REMOTES.ManageParty.OnClientInvoke(k, v)
  927. if k == "Invite" then
  928. MAIN_GUI.Invitation.TextLabel.Text = "PARTY INVITATION FROM " .. string.upper(v.Name)
  929. MAIN_GUI.Invitation.Visible = true
  930. cur_invitation = v
  931. elseif k == "Update" then
  932. upd_party(v)
  933. elseif k == "RefreshInvitations" then
  934. upd_invites()
  935. end
  936. end
  937. MAIN_GUI.Invitation.Accept.MouseButton1Up:connect(function()
  938. if bup then
  939. return
  940. end
  941. bup = true
  942. local info = REMOTES.ManageParty:InvokeServer("AcceptInvite", cur_invitation)
  943. upd_party(info)
  944. MAIN_GUI.Invitation.Visible = false
  945. bup = false
  946. end)
  947. MAIN_GUI.Invitation.Cancel.MouseButton1Up:connect(function()
  948. MAIN_GUI.Invitation.Visible = false
  949. end)
  950. local graph = require(game.ReplicatedStorage.Graph)
  951. local stats = _G.PlayersData[player].Data.Stats
  952. local upd, fx = graph.Start(MAIN_GUI.Character.Graph, {
  953. {
  954. "Power",
  955. stats.Power
  956. },
  957. {
  958. "Defense",
  959. stats.Defense
  960. },
  961. {
  962. "Speed",
  963. stats.Speed
  964. },
  965. {
  966. "Max Health",
  967. stats.MaxHP
  968. },
  969. {
  970. "Max Mana",
  971. stats.MaxMP
  972. },
  973. {
  974. "Max Stamina",
  975. stats.MaxSP
  976. }
  977. }, 100)
  978. local function updateCharMenu(data)
  979. data = data or _G.PlayersData[player].Data
  980. local stats = data.Stats
  981. MAIN_GUI.Character.Points.Text = "Available skill points: " .. data.Points
  982. upd({
  983. {
  984. "Power",
  985. stats.Power
  986. },
  987. {
  988. "Defense",
  989. stats.Defense
  990. },
  991. {
  992. "Speed",
  993. stats.Speed
  994. },
  995. {
  996. "Max Health",
  997. stats.MaxHP
  998. },
  999. {
  1000. "Max Mana",
  1001. stats.MaxMP
  1002. },
  1003. {
  1004. "Max Stamina",
  1005. stats.MaxSP
  1006. }
  1007. })
  1008. end
  1009. function REMOTES.SpendPoint.OnClientInvoke(data)
  1010. updateCharMenu(data)
  1011. end
  1012. local isVip = false
  1013. coroutine.resume(coroutine.create(function()
  1014. isVip = REMOTES.IsVipServer:InvokeServer()
  1015. end))
  1016. local MarketplaceService = game:GetService("MarketplaceService")
  1017. for i, v in next, shopTable, nil do
  1018. do
  1019. local key = string.match(v.Name, "(.+)")
  1020. local mg = robuxshop[key]
  1021. if mg then
  1022. v.MouseButton1Up:connect(function()
  1023. if mg.ProductId then
  1024. if key == "RainDrop" and isVip then
  1025. return
  1026. end
  1027. MarketplaceService:PromptProductPurchase(player, mg.ProductId)
  1028. else
  1029. MarketplaceService:PromptPurchase(player, mg.PassId)
  1030. end
  1031. end)
  1032. end
  1033. end
  1034. end
  1035. MAIN_GUI.Character.Reset.MouseButton1Up:connect(function()
  1036. MarketplaceService:PromptProductPurchase(player, robuxshop.ResetPoints.ProductId)
  1037. end)
  1038. REMOTES.RefreshCharacterPage.OnClientEvent:connect(function()
  1039. updateCharMenu()
  1040. end)
  1041. MAIN_GUI.Frame1.Character.MouseButton1Up:connect(function()
  1042. if tuts <= 1 then
  1043. return
  1044. end
  1045. if not MAIN_GUI.Character.Visible then
  1046. updateAvailableMoves()
  1047. if selectedBind then
  1048. selectAttack(selectedBind, Enum.UserInputState.Begin)
  1049. end
  1050. updateCharMenu()
  1051. else
  1052. MAIN_GUI.SelectSlot.Position = UDim2.new(0, -1000, 0, 0)
  1053. currentMoveSelected = nil
  1054. bindKeys()
  1055. end
  1056. MAIN_GUI.Character.Visible = not MAIN_GUI.Character.Visible
  1057. if MAIN_GUI.Shop.Visible or MAIN_GUI.Book.Visible then
  1058. MAIN_GUI.Shop.Visible = false
  1059. MAIN_GUI.Book.Visible = false
  1060. end
  1061. if UIS.TouchEnabled then
  1062. game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Chat, not MAIN_GUI.Character.Visible and not MAIN_GUI.Shop.Visible and not MAIN_GUI.Book.Visible)
  1063. end
  1064. end)
  1065. MAIN_GUI.Frame1.Shop.MouseButton1Up:connect(function()
  1066. if tuts <= 1 then
  1067. return
  1068. end
  1069. MAIN_GUI.Shop.Visible = not MAIN_GUI.Shop.Visible
  1070. if MAIN_GUI.Book.Visible or MAIN_GUI.Character.Visible then
  1071. MAIN_GUI.Book.Visible = false
  1072. MAIN_GUI.Character.Visible = false
  1073. end
  1074. if UIS.TouchEnabled then
  1075. game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Chat, not MAIN_GUI.Character.Visible and not MAIN_GUI.Shop.Visible and not MAIN_GUI.Book.Visible)
  1076. end
  1077. end)
  1078. local curSel = false
  1079. local enb = false
  1080. MAIN_GUI.Book.UnlockFrame.Unlock.MouseButton1Up:connect(function()
  1081. if curSel and not enb then
  1082. enb = true
  1083. local suc = REMOTES.UnlockElement:InvokeServer(curSel)
  1084. if suc then
  1085. _G.playSound("PurchaseSuccess")
  1086. updateBookInfo()
  1087. updateBookMagicInfo(not suc, curSel)
  1088. local v
  1089. for i, v2 in next, curSel.Attacks, nil do
  1090. if v2.Id == 1 then
  1091. v = v2
  1092. break
  1093. end
  1094. end
  1095. if v then
  1096. updateAvailableMoves()
  1097. local moveIndex
  1098. local binds = {}
  1099. for i, v2 in next, availableMoves, nil do
  1100. if v2.keybind then
  1101. binds[v2.keybind] = true
  1102. end
  1103. if v2.move.Name == v.Name then
  1104. moveIndex = i
  1105. end
  1106. end
  1107. for i = 1, 5 do
  1108. if not binds[i] then
  1109. binds[i] = true
  1110. availableMoves[moveIndex].keybind = i
  1111. break
  1112. end
  1113. end
  1114. bindKeys()
  1115. end
  1116. else
  1117. _G.playSound("PurchaseFailure")
  1118. end
  1119. enb = false
  1120. end
  1121. end)
  1122. local cac = {
  1123. UDim2.new(0.175, 0, 0, 0),
  1124. UDim2.new(0.65, 0, 0, 0),
  1125. UDim2.new(0.175, 0, 0.35, 0),
  1126. UDim2.new(0.65, 0, 0.35, 0),
  1127. UDim2.new(0.425, 0, 0.7, 0)
  1128. }
  1129. local consBuy = {}
  1130. local buS = false
  1131. function updateBookMagicInfo(locked, info)
  1132. curSel = info
  1133. MAIN_GUI.Book.Title2.Text = info.Name
  1134. MAIN_GUI.Book.InfoFrame.Visible = false
  1135. MAIN_GUI.Book.UnlockFrame.Visible = false
  1136. if locked then
  1137. MAIN_GUI.Book.UnlockFrame.Visible = true
  1138. if info.Fusion then
  1139. MAIN_GUI.Book.UnlockFrame.Unlock.Image = "rbxassetid://567304132"
  1140. MAIN_GUI.Book.UnlockFrame.Diamonds.Visible = false
  1141. for i, v in next, MAIN_GUI.Book.UnlockFrame.Elements:GetChildren() do
  1142. v.Visible = true
  1143. end
  1144. MAIN_GUI.Book.UnlockFrame.Elements.First.Image = MAGICS[info.Fusion[1]].Image
  1145. MAIN_GUI.Book.UnlockFrame.Elements.First.TextLabel.Text = _G.PlayersData[player].Data.Magics[info.Fusion[1]] and "(" .. _G.PlayersData[player].Data.Magics[info.Fusion[1]].Unlocked .. "/5)" or "LOCKED"
  1146. MAIN_GUI.Book.UnlockFrame.Elements.Second.Image = MAGICS[info.Fusion[2]].Image
  1147. MAIN_GUI.Book.UnlockFrame.Elements.Second.TextLabel.Text = _G.PlayersData[player].Data.Magics[info.Fusion[2]] and "(" .. _G.PlayersData[player].Data.Magics[info.Fusion[2]].Unlocked .. "/5)" or "LOCKED"
  1148. MAIN_GUI.Book.UnlockFrame.Elements.Second.TextLabel.Visible = true
  1149. MAIN_GUI.Book.UnlockFrame.Elements.Third.Image = info.Image
  1150. if _G.PlayersData[player].Data.Magics[info.Fusion[1]] and _G.PlayersData[player].Data.Magics[info.Fusion[1]].Unlocked >= 5 then
  1151. MAIN_GUI.Book.UnlockFrame.Elements.First.ImageLabel.Visible = true
  1152. else
  1153. MAIN_GUI.Book.UnlockFrame.Elements.First.ImageLabel.Visible = false
  1154. end
  1155. if _G.PlayersData[player].Data.Magics[info.Fusion[2]] and _G.PlayersData[player].Data.Magics[info.Fusion[2]].Unlocked >= 5 then
  1156. MAIN_GUI.Book.UnlockFrame.Elements.Second.ImageLabel.Visible = true
  1157. else
  1158. MAIN_GUI.Book.UnlockFrame.Elements.Second.ImageLabel.Visible = false
  1159. end
  1160. if info.Cost and info.Cost > 0 then
  1161. MAIN_GUI.Book.UnlockFrame.Unlock.Image = "rbxassetid://567304072"
  1162. MAIN_GUI.Book.UnlockFrame.Diamonds.TextLabel.Text = info.Cost or "?"
  1163. MAIN_GUI.Book.UnlockFrame.Diamonds.Visible = true
  1164. end
  1165. else
  1166. for i, v in next, MAIN_GUI.Book.UnlockFrame.Elements:GetChildren() do
  1167. v.Visible = false
  1168. end
  1169. MAIN_GUI.Book.UnlockFrame.Elements.Second.ImageLabel.Visible = false
  1170. MAIN_GUI.Book.UnlockFrame.Elements.Second.TextLabel.Visible = false
  1171. MAIN_GUI.Book.UnlockFrame.Elements.Second.Visible = true
  1172. MAIN_GUI.Book.UnlockFrame.Elements.Second.Image = info.Image
  1173. MAIN_GUI.Book.UnlockFrame.Unlock.Image = "rbxassetid://567304072"
  1174. MAIN_GUI.Book.UnlockFrame.Diamonds.TextLabel.Text = info.Cost or "?"
  1175. MAIN_GUI.Book.UnlockFrame.Diamonds.Visible = true
  1176. end
  1177. else
  1178. for i, v in next, MAIN_GUI.Book.InfoFrame.Moves:GetChildren() do
  1179. if v:IsA("ImageButton") then
  1180. v:Destroy()
  1181. end
  1182. end
  1183. MAIN_GUI.Book.InfoFrame.Visible = true
  1184. for i = 1, 5 do
  1185. local thing = MAIN_GUI.Book.InfoFrame.Moves["b" .. i]
  1186. thing.Visible = false
  1187. end
  1188. for i, v in next, consBuy, nil do
  1189. v:disconnect()
  1190. end
  1191. for i, v in next, info.Attacks, nil do
  1192. do
  1193. local s = createSkill(v)
  1194. s.Name = info.Name .. "/" .. i
  1195. s.Position = cac[v.Id]
  1196. s.Size = UDim2.new(0.2, 0, 0.2, 0)
  1197. local thing = MAIN_GUI.Book.InfoFrame.Moves["b" .. v.Id]
  1198. if _G.PlayersData[player].Data.Magics[info.Name].Unlocked >= v.Id then
  1199. thing.Visible = false
  1200. thing.ImageTransparency = 1
  1201. thing.TextButton.Visible = false
  1202. thing.TextLabel.Visible = false
  1203. thing.Locked.Visible = false
  1204. local img = Instance.new("ImageLabel")
  1205. img.BackgroundTransparency = 1
  1206. img.Image = "rbxassetid://566634511"
  1207. img.Position = UDim2.new(0, 0, 0, 0)
  1208. img.Size = UDim2.new(1, 0, 1, 0)
  1209. img.ZIndex = s.ZIndex + 1
  1210. img.Parent = s
  1211. elseif _G.PlayersData[player].Data.Magics[info.Name].Unlocked + 1 >= v.Id then
  1212. thing.Visible = true
  1213. thing.ImageTransparency = 0
  1214. thing.TextButton.Visible = true
  1215. thing.TextLabel.Visible = true
  1216. thing.TextLabel.Text = v.Cost
  1217. thing.Locked.Visible = false
  1218. consBuy[#consBuy + 1] = thing.TextButton.MouseButton1Up:connect(function()
  1219. if buS then
  1220. return
  1221. end
  1222. buS = true
  1223. local suc = REMOTES.UnlockSpell:InvokeServer(info.Name, v.Name)
  1224. if suc then
  1225. _G.playSound("PurchaseSuccess")
  1226. updateBookInfo()
  1227. updateBookMagicInfo(false, info)
  1228. updateAvailableMoves()
  1229. local moveIndex
  1230. local binds = {}
  1231. for i, v2 in next, availableMoves, nil do
  1232. if v2.keybind then
  1233. binds[v2.keybind] = true
  1234. end
  1235. if v2.move.Name == v.Name then
  1236. moveIndex = i
  1237. end
  1238. end
  1239. for i = 1, 5 do
  1240. if not binds[i] then
  1241. binds[i] = true
  1242. availableMoves[moveIndex].keybind = i
  1243. break
  1244. end
  1245. end
  1246. bindKeys()
  1247. else
  1248. _G.playSound("PurchaseFailure")
  1249. end
  1250. buS = false
  1251. end)
  1252. else
  1253. thing.Visible = true
  1254. thing.ImageTransparency = 1
  1255. thing.TextButton.Visible = false
  1256. thing.TextLabel.Visible = false
  1257. thing.Locked.Visible = true
  1258. end
  1259. s.Parent = MAIN_GUI.Book.InfoFrame.Moves
  1260. end
  1261. end
  1262. MAIN_GUI.Book.InfoFrame.Moves.Visible = true
  1263. end
  1264. end
  1265. local consBook = {}
  1266. function updateBookInfo()
  1267. for i, v in next, consBook, nil do
  1268. v:disconnect()
  1269. end
  1270. MAIN_GUI.Book.Scroll.CanvasSize = UDim2.new(0, 0, 0, 0)
  1271. for i, v in next, MAIN_GUI.Book.Scroll:GetChildren() do
  1272. if v.Name ~= "CloneFrame" and not v:IsA("UIComponent") then
  1273. v:Destroy()
  1274. end
  1275. end
  1276. local subIndex = 1
  1277. for i, v in next, MAGICS, nil do
  1278. do
  1279. local hidden = false
  1280. hidden = hidden or i == "Sans" and not _G.PlayersData[player].Data.Magics[i]
  1281. if not hidden then
  1282. end
  1283. if 0 < v.Index and not hidden then
  1284. local locked = tutorial == false and not _G.PlayersData[player].Data.Magics[i] or tutorial and v.Index > 3
  1285. local f = MAIN_GUI.Book.Scroll.CloneFrame:Clone()
  1286. f.Name = i .. "Frame"
  1287. f.Visible = true
  1288. f.LayoutOrder = v.Index
  1289. f.Icon.Image = v.Image
  1290. f.Button.Text = i
  1291. f.Icon.ImageColor3 = locked and Color3.new() or Color3.new(1, 1, 1)
  1292. f.Button.TextStrokeColor3 = locked and Color3.new() or v.ImageColor:lerp(Color3.new(), 0.2)
  1293. if locked then
  1294. local img = Instance.new("ImageLabel")
  1295. img.BackgroundTransparency = 1
  1296. img.Image = "rbxassetid://566840786"
  1297. img.Position = UDim2.new(0, -9, 0, -9)
  1298. img.Size = UDim2.new(1, 14, 1, 14)
  1299. img.ZIndex = f.ZIndex + 1
  1300. img.Parent = f.Icon
  1301. end
  1302. consBook[#consBook + 1] = f.Button.MouseButton1Up:connect(function()
  1303. updateBookMagicInfo(not _G.PlayersData[player].Data.Magics[i], v)
  1304. end)
  1305. consBook[#consBook + 1] = f.Icon.MouseButton1Up:connect(function()
  1306. updateBookMagicInfo(not _G.PlayersData[player].Data.Magics[i], v)
  1307. end)
  1308. f.Parent = MAIN_GUI.Book.Scroll
  1309. end
  1310. end
  1311. end
  1312. local amountOfMagics = 0
  1313. for _, v in pairs(MAIN_GUI.Book.Scroll:GetChildren()) do
  1314. if v:IsA("Frame") and v.Visible then
  1315. amountOfMagics = amountOfMagics + 1
  1316. end
  1317. end
  1318. MAIN_GUI.Book.Scroll.CanvasSize = UDim2.new(0, 0, 0.15 * amountOfMagics, 0)
  1319. MAIN_GUI.Book.Scroll.UIGridLayout.CellSize = UDim2.new(1, 0, 1 / amountOfMagics, -1)
  1320. end
  1321. MAIN_GUI.Frame1.Book.MouseButton1Up:connect(function()
  1322. if tuts <= 1 then
  1323. return
  1324. end
  1325. if not MAIN_GUI.Book.Visible then
  1326. updateBookInfo()
  1327. end
  1328. MAIN_GUI.Book.Visible = not MAIN_GUI.Book.Visible
  1329. if MAIN_GUI.Shop.Visible or MAIN_GUI.Character.Visible then
  1330. MAIN_GUI.Shop.Visible = false
  1331. MAIN_GUI.Character.Visible = false
  1332. end
  1333. if UIS.TouchEnabled then
  1334. game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Chat, not MAIN_GUI.Character.Visible and not MAIN_GUI.Shop.Visible and not MAIN_GUI.Book.Visible)
  1335. end
  1336. end)
  1337. local Touch_Tick = tick()
  1338. function touchy(h)
  1339. if not h.Parent then
  1340. return
  1341. end
  1342. if h.Parent.Name == "Increase Cap" then
  1343. print(expNeeded(_G.PlayersData[player].Data.Level), _G.PlayersData[player].Data.Level)
  1344. end
  1345. if h.Parent.Name == "Increase Cap" and _G.PlayersData[player].Data.Level >= 225 + _G.PlayersData[player].Data.ExtraLevelCap and _G.PlayersData[player].Data.Exp >= expNeeded(_G.PlayersData[player].Data.Level) - 1 and _G.PlayersData[player].Data.Shards >= 10000 then
  1346. MAIN_GUI.increase.Visible = true
  1347. end
  1348. end
  1349. hrp.Touched:connect(touchy)
  1350. MAIN_GUI:WaitForChild("increase"):WaitForChild("Accept").MouseButton1Up:connect(function()
  1351. MAIN_GUI.increase.Visible = false
  1352. REMOTES.IncreaseCap:FireServer()
  1353. end)
  1354. MAIN_GUI:WaitForChild("increase"):WaitForChild("Cancel").MouseButton1Up:connect(function()
  1355. MAIN_GUI.increase.Visible = false
  1356. end)
  1357. local shakeStart = 0
  1358. local shakeDuration = 0
  1359. local shakeIntensity = 0
  1360. function _G.ShakeCamera(intensity, duration)
  1361. shakeStart = tick()
  1362. shakeDuration = math.clamp(shakeDuration + 1, 0, 8)
  1363. shakeIntensity = math.clamp(shakeIntensity + intensity, 0, 10)
  1364. end
  1365. local multiplier = 0.016666666666666666
  1366. local speedrequired = 120
  1367. local notShard, notDiamond, notSafe
  1368. local prevData = _G.PlayersData[player]
  1369. if not prevData then
  1370. repeat
  1371. prevData = _G.PlayersData[player]
  1372. wait(0)
  1373. until prevData
  1374. end
  1375. local lastBlock = false
  1376. local startF = tick()
  1377. local lastTick = tick()
  1378. while wait(0) do
  1379. local delta = tick() - lastTick
  1380. local my = _G.PlayersData[player]
  1381. if tick() - startF > 3 then
  1382. REMOTES.ClientData:FireServer(_G.ClientsData[player])
  1383. end
  1384. hb.TextLabel.Text = "HEALTH (" .. math.ceil(humanoid.Health * 10) .. "/" .. math.ceil(humanoid.MaxHealth * 10) .. ")"
  1385. hb.Empty.Size = UDim2.new(1 - humanoid.Health / humanoid.MaxHealth, 0, 1, 0)
  1386. hb.Empty.Position = UDim2.new(humanoid.Health / humanoid.MaxHealth, 0, 0, 0)
  1387. eb.TextLabel.Text = "MANA (" .. math.ceil(my.Mana * 10) .. "/" .. math.ceil(my.MaxMana * 10) .. ")"
  1388. eb.Empty:TweenSizeAndPosition(UDim2.new(1 - my.Mana / my.MaxMana, 0, 1, 0), UDim2.new(my.Mana / my.MaxMana, 0, 0, 0), "In", "Linear", 0.5, true)
  1389. sb.TextLabel.Text = "STAMINA (" .. math.ceil(my.Stamina * 10) .. "/" .. math.ceil(my.MaxStamina * 10) .. ")"
  1390. sb.Empty:TweenSizeAndPosition(UDim2.new(1 - my.Stamina / my.MaxStamina, 0, 1, 0), UDim2.new(my.Stamina / my.MaxStamina, 0, 0, 0), "In", "Linear", 0.5, true)
  1391. reqM.BackgroundTransparency = reqM.BackgroundTransparency + delta
  1392. reqM2.BackgroundTransparency = reqM2.BackgroundTransparency + delta
  1393. lvl.Text = "Lvl. " .. my.Data.Level
  1394. exp.Empty.Size = UDim2.new(1 - my.Data.Exp / expNeeded(my.Data.Level), 0, 1, 0)
  1395. exp.Empty.Position = UDim2.new(my.Data.Exp / expNeeded(my.Data.Level), 0, 0, 0)
  1396. exp.TextLabel.Text = "EXP: " .. my.Data.Exp .. "/" .. expNeeded(my.Data.Level)
  1397. shards.TextLabel.Text = my.Data.Shards
  1398. diamonds.TextLabel.Text = my.Data.Diamonds
  1399. if my.Stamina <= 0 then
  1400. my.Running = false
  1401. _G.running = false
  1402. elseif my.Blocking and _G.Blocking and lastBlock == false then
  1403. lastBlock = true
  1404. _G.PlayAnim("Block", 0.5, 10, 0.01)
  1405. elseif not my.Blocking and lastBlock == true then
  1406. lastBlock = false
  1407. _G.StopAnim("Block", 0.5)
  1408. _G.Blocking = false
  1409. end
  1410. humanoid.WalkSpeed = (_G.running and 32 or 16) * my.SpeedMultiplier * (0.6 + humanoid.Health / humanoid.MaxHealth * 0.4)
  1411. local velocity = hrp.Velocity
  1412. if shakeDuration <= 0 and velocity.y < -speedrequired then
  1413. local ray = Ray.new(hrp.CFrame.p, Vector3.new(0, -math.abs(velocity.y / 12), 0))
  1414. local hit, pos = workspace:FindPartOnRayWithIgnoreList(ray, {character})
  1415. if hit then
  1416. if hit.Parent.Name == ".Water" then
  1417. hrp.Velocity = hrp.Velocity - Vector3.new(0, hrp.Velocity.y / 2, 0)
  1418. _G.playSound("WaterSplash", hrp)
  1419. else
  1420. _G.ShakeCamera(-velocity.y * multiplier, -velocity.y * multiplier * 0.5)
  1421. _G.playSound("GroundCrash", hrp)
  1422. end
  1423. end
  1424. end
  1425. if shakeDuration > 0 and shakeStart > 0 then
  1426. humanoid.CameraOffset = Vector3.new(shakeIntensity * math.random() - shakeIntensity / 2, shakeIntensity * math.random() - shakeIntensity / 2, shakeIntensity * math.random() - shakeIntensity / 2) * shakeDuration
  1427. shakeDuration = shakeDuration - delta
  1428. elseif shakeIntensity < 0 or shakeDuration < 0 then
  1429. shakeIntensity = 0
  1430. shakeDuration = 0
  1431. humanoid.CameraOffset = Vector3.new()
  1432. end
  1433. if MAIN_GUI.Character.Visible then
  1434. fx()
  1435. end
  1436. if prevData.Data.Shards - my.Data.Shards ~= 0 then
  1437. do
  1438. local diff = my.Data.Shards - prevData.Data.Shards
  1439. local txt = diff > 0 and "+" .. diff or diff
  1440. if notShard then
  1441. do
  1442. local d = notShard
  1443. d:TweenPosition(UDim2.new(0.5, -140, 0, -75), "In", "Quad", 0.5, true, function()
  1444. d:Destroy()
  1445. end)
  1446. notShard = nil
  1447. end
  1448. end
  1449. local n = MAIN_GUI.NotifyShard:Clone()
  1450. n.Position = UDim2.new(0.5, -180, 0, -75)
  1451. n.TextLabel.Text = txt
  1452. notShard = n
  1453. n.Parent = MAIN_GUI
  1454. n:TweenPosition(UDim2.new(0.5, -180, 0.075, 10), "Out", "Quad", 0.5, true, function()
  1455. wait(2)
  1456. if notShard == n then
  1457. notShard = nil
  1458. n:TweenPosition(UDim2.new(0.5, -180, 0, -75), "In", "Quad", 0.5, true, function()
  1459. n:Destroy()
  1460. end)
  1461. end
  1462. end)
  1463. end
  1464. end
  1465. if prevData.Data.Diamonds - my.Data.Diamonds ~= 0 then
  1466. do
  1467. local diff = my.Data.Diamonds - prevData.Data.Diamonds
  1468. local txt = diff > 0 and "+" .. diff or diff
  1469. if notDiamond then
  1470. do
  1471. local d = notDiamond
  1472. d:TweenPosition(UDim2.new(0.5, 20, 0, -75), "In", "Quad", 0.5, true, function()
  1473. d:Destroy()
  1474. end)
  1475. notDiamond = nil
  1476. end
  1477. end
  1478. local n = MAIN_GUI.NotifyDiamond:Clone()
  1479. n.Position = UDim2.new(0.5, 60, 0, -75)
  1480. n.TextLabel.Text = txt
  1481. notDiamond = n
  1482. n.Parent = MAIN_GUI
  1483. n:TweenPosition(UDim2.new(0.5, 60, 0.075, 10), "Out", "Quad", 0.5, true, function()
  1484. wait(2)
  1485. if notDiamond == n then
  1486. notDiamond = nil
  1487. n:TweenPosition(UDim2.new(0.5, 60, 0, -75), "In", "Quad", 0.5, true, function()
  1488. n:Destroy()
  1489. end)
  1490. end
  1491. end)
  1492. end
  1493. end
  1494. local safe = false
  1495. for i, v in next, safezones, nil do
  1496. if (v.pos - hrp.Position).magnitude < v.radius then
  1497. safe = true
  1498. break
  1499. end
  1500. end
  1501. _G.safezoned = safe
  1502. MAIN_GUI.Safezone.Visible = _G.safezoned
  1503. for i, v in next, my_party, nil do
  1504. local char = v.Character
  1505. if char then
  1506. local hum = char:FindFirstChild("Humanoid")
  1507. local phrp = char:FindFirstChild("HumanoidRootPart")
  1508. local phead = char:FindFirstChild("Head")
  1509. if hum then
  1510. for i2, v2 in next, members_frame.Frame:GetChildren() do
  1511. if v.Name == v2.Name then
  1512. v2.Frame.Frame.Size = UDim2.new(hum.Health / hum.MaxHealth, 0, 1, 0)
  1513. end
  1514. end
  1515. end
  1516. end
  1517. end
  1518. prevData = my
  1519. lastTick = tick()
  1520. end
  1521. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement