Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --SynapseX Decompiler
- return function()
- print("RUNNING MODULE")
- local expNeeded = function(l)
- return 41 + math.ceil(l ^ 1.95 + l * 8)
- end
- _G.Cooldowns = {}
- function _G.isBusy()
- for i, v in next, _G.Cooldowns, nil do
- if v[3] == true then
- return true
- end
- end
- end
- _G.Blocking = false
- _G.KO = 0
- function _G.isKO()
- return _G.KO > 0 or _G.PlayersData[game.Players.LocalPlayer].Stunned
- end
- _G.ClientsData = {}
- _G.PlayersData = {}
- _G.BlockedMoves = {}
- local robuxshop = {
- D1 = {
- Name = "",
- Description = "",
- ProductId = 47584996
- },
- D2 = {
- Name = "",
- Description = "",
- ProductId = 47585001
- },
- D3 = {
- Name = "",
- Description = "",
- ProductId = 47585008
- },
- D4 = {
- Name = "",
- Description = "",
- ProductId = 47585476
- },
- S1 = {
- Name = "",
- Description = "",
- ProductId = 47585486
- },
- S2 = {
- Name = "",
- Description = "",
- ProductId = 47585498
- },
- S3 = {
- Name = "",
- Description = "",
- ProductId = 47585565
- },
- S4 = {
- Name = "",
- Description = "",
- ProductId = 47585574
- },
- RainDrop = {
- Name = "Drops Rain",
- 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!",
- ProductId = 47585712
- },
- ResetPoints = {
- Name = "Refund Stat Points",
- Description = "Want to change your stat selection? Use this to get a refund on your stat points to remake your selection.",
- ProductId = 47585735
- },
- Vip = {
- Name = "VIP",
- Description = [[
- +1.5x shard drop value when you pick them up
- +1.5x EXP multiplier for using magic
- +An exclusive yellow chat color for VIP members only
- +Shard tracker - every time a shard spawns on the map, a ray from coming from the sky will show its location for 3 seconds!
- +Get 1 bonus shard every time someone else picks one up
- ]],
- PassId = 603389312
- },
- Premium = {
- Name = "Premium",
- Description = [[
- +Pick up diamonds for 2x their value!
- +2x EXP (stacks, 3x if you own VIP)
- +An exclusive red chat color for Premium members only
- +Diamond tracker - every time a diamond spawns on the map, a ray coming from the sky will show its location for 3 seconds!
- +2x shards value (stacks, 3x if you own vip, only if you pick them up)
- +Get 2 shards every time someone else picks up one(stacks, 3 if you own vip)
- +Lower ultimate cool down when you spawn]],
- PassId = 604671045
- },
- Heaven = {
- Name = "Exclusive Map",
- Description = "Get access to a game pass only map with a higher shard and diamond drop rate!",
- PassId = 604668911
- },
- Aura = {
- Name = "White Aura",
- Description = "This game pass will grant you a white cosmetic aura that you can show off to your friends!",
- PassId = 738905856
- }
- }
- local CAMERA = workspace.CurrentCamera
- local STORAGE = game:GetService("ReplicatedStorage")
- local MAGICS = require(STORAGE:WaitForChild("Magics"))
- local TYPE_IMAGES = require(STORAGE.Magics:WaitForChild("TypeImages"))
- local Enums = require(STORAGE.Magics:WaitForChild("Enums"))
- _G.MAGICS = MAGICS
- STORAGE:WaitForChild("Magics"):Destroy()
- local StarterGui = game:GetService("StarterGui")
- StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
- local player = game.Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- local humanoid = character:WaitForChild("Humanoid")
- local hrp = character:WaitForChild("HumanoidRootPart")
- local UIS = game:GetService("UserInputService")
- local REMOTES = STORAGE:WaitForChild("Remotes")
- player.CharacterAdded:connect(function(c)
- _G.running = false
- character = c
- humanoid = c:WaitForChild("Humanoid")
- hrp = c:WaitForChild("HumanoidRootPart")
- hrp.Touched:connect(touchy)
- _G.Cooldowns = {}
- _G.BlockedMoves = {}
- _G.KO = 0
- for i, v in next, MAGICS, nil do
- for i2, v2 in next, v.Attacks, nil do
- _G.Cooldowns[v2.Type] = {
- v2.MagicType,
- v2.Name,
- false
- }
- if v2.Type == Enums.MoveType.Ultimate then
- _G.BlockedMoves[v2.Type] = true
- end
- end
- end
- end)
- _G.safezoned = true
- local safezones = {}
- for i, v in next, workspace:WaitForChild("Map"):WaitForChild("SafeZones"):GetChildren() do
- safezones[#safezones + 1] = {
- pos = v.Position,
- radius = v.Mesh.Scale.x / 2
- }
- end
- print("SAFEZONES")
- local holding = false
- local mouse = player:GetMouse()
- local ign = workspace:WaitForChild(".Ignore")
- mouse.TargetFilter = ign
- local GUI = player:WaitForChild("PlayerGui")
- local MAIN_GUI = GUI:WaitForChild("Main")
- local reqM2 = MAIN_GUI:WaitForChild("RequiredBar")
- reqM2.Name = "RequiredStamina"
- local reqM = MAIN_GUI:WaitForChild("RequiredStamina"):Clone()
- reqM.Name = "RequiredMana"
- reqM.Parent = MAIN_GUI:WaitForChild("SkillsBar"):WaitForChild("Energy")
- local hb = MAIN_GUI.SkillsBar.Health
- local eb = MAIN_GUI.SkillsBar.Energy
- local sb = MAIN_GUI.SkillsBar.Stamina
- local exp = MAIN_GUI.Frame1.Experience
- local lvl = MAIN_GUI.Frame1.Level.TextLabel
- local shards = MAIN_GUI.Frame1.Shards
- local diamonds = MAIN_GUI.Frame1.Diamonds
- local shopTable = {}
- for _, v in pairs(MAIN_GUI:WaitForChild("Shop").GamepassesContainer:GetChildren()) do
- table.insert(shopTable, v)
- end
- for _, v in pairs(MAIN_GUI:WaitForChild("Shop").ProductsContainer:GetChildren()) do
- table.insert(shopTable, v)
- end
- print("PASSES")
- local availableMoves = {}
- for i, v in next, MAGICS, nil do
- for i2, v2 in next, v.Attacks, nil do
- _G.Cooldowns[v2.Type] = {
- v2.MagicType,
- v2.Name,
- false
- }
- end
- end
- REMOTES.ClientData.OnClientEvent:connect(function(player, data)
- _G.ClientsData[player] = data
- end)
- REMOTES.PlayerData.OnClientEvent:connect(function(player, data)
- _G.PlayersData[player] = data
- end)
- REMOTES.Combat.OnClientEvent:connect(function(stun, dir)
- _G.KO = _G.KO + stun
- humanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)
- hrp.Velocity = dir or Vector3.new()
- end)
- local currentMoveSelected
- repeat
- wait(0)
- until _G.PlayersData[player]
- print("READY")
- local tutorial = _G.PlayersData[player].Data.Diamonds == 150 and _G.PlayersData[player].Data.Level == 0 and _G.PlayersData[player].Data.Exp == 0
- if tutorial then
- do
- local w = MAIN_GUI.Frame1.TutWindow.Next
- local w2 = MAIN_GUI.welcome.ImageButton
- w.MouseEnter:connect(function()
- w.ImageColor3 = Color3.new(0.85, 0.85, 0.85)
- end)
- w.MouseLeave:connect(function()
- w.ImageColor3 = Color3.new(1, 1, 1)
- end)
- w2.MouseEnter:connect(function()
- w2.ImageColor3 = Color3.new(0.85, 0.85, 0.85)
- end)
- w2.MouseLeave:connect(function()
- w2.ImageColor3 = Color3.new(1, 1, 1)
- end)
- end
- end
- local tuts = 0
- local function updateTutorial()
- tuts = tuts + 1
- local a = MAIN_GUI.Frame1.Arrow
- local w = MAIN_GUI.Frame1.TutWindow
- local t = w.TutorialText
- if tuts == 1 then
- w.Next.Image = "rbxassetid://619804494"
- a.Position = UDim2.new(1, 0, 0.75, 0)
- a.Rotation = -180
- w.Position = UDim2.new(0, 5, -1, 0)
- t.Text = "This is your Diamonds and Shards. You can spend these on new elements to fight!"
- w.Visible = true
- a.Visible = true
- w.Next.MouseButton1Up:wait()
- w.Next.Visible = false
- updateTutorial()
- elseif tuts == 2 then
- a.Position = UDim2.new(0.35, 0, -0.3, 0)
- a.Rotation = 90
- w.Position = UDim2.new(0, 5, -1, 0)
- t.Text = "This blue button is the elements shop, you can purchase your starter element here. Click it to continue."
- MAIN_GUI.Frame1.Book.MouseButton1Up:wait()
- updateTutorial()
- elseif tuts == 3 then
- w.Position = UDim2.new(0, 5, 0.5, 0)
- a.Visible = false
- t.Text = "Please choose your first element. Click purchase on one of these starter elements to continue."
- do
- local con
- con = MAIN_GUI.Book.InfoFrame.Changed:connect(function()
- if MAIN_GUI.Book.InfoFrame.Visible then
- con:disconnect()
- updateTutorial()
- end
- end)
- end
- elseif tuts == 4 then
- t.Text = "Great! Now purchase 2 moves for this element for 75 and 100 Shards."
- MAIN_GUI.Book.InfoFrame.Moves.b2.TextButton.MouseButton1Up:wait()
- updateTutorial()
- elseif tuts == 5 then
- t.Text = "Good job! Buy 1 more move for 100 Shards."
- MAIN_GUI.Book.InfoFrame.Moves.b3.TextButton.MouseButton1Up:wait()
- updateTutorial()
- elseif tuts == 6 then
- w.Position = UDim2.new(0, 5, -1, 0)
- a.Position = UDim2.new(0.1, 0, -0.3, 0)
- a.Visible = true
- t.Text = "Now, click the orange button to view your inventory and character stats."
- MAIN_GUI.Frame1.Character.MouseButton1Up:wait()
- updateTutorial()
- elseif tuts == 7 then
- w.Position = UDim2.new(0, 5, 0.6, 0)
- a.Visible = false
- w.Next.Visible = true
- 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."
- w.Next.MouseButton1Up:wait()
- updateTutorial()
- elseif tuts == 8 then
- w.Position = UDim2.new(0, 5, -1, 0)
- MAIN_GUI.SelectSlot.Position = UDim2.new(0, -400, 0, 0)
- currentMoveSelected = nil
- bindKeys()
- MAIN_GUI.Character.Visible = false
- if MAIN_GUI.Shop.Visible or MAIN_GUI.Book.Visible then
- MAIN_GUI.Shop.Visible = false
- MAIN_GUI.Book.Visible = false
- end
- if UIS.TouchEnabled then
- game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Chat, not MAIN_GUI.Character.Visible and not MAIN_GUI.Shop.Visible and not MAIN_GUI.Book.Visible)
- end
- t.Text = "To level up, practice using your magic. You can also defeat other players to gain more experience and shards."
- w.Next.MouseButton1Up:wait()
- updateTutorial()
- elseif tuts == 9 then
- if UIS.TouchEnabled then
- t.Text = "The controls are: double tap your jump button to flip and press the small gray button on the right to run."
- else
- t.Text = "There are also a few important movement controls. Double tap WASD to do flips and press Ctrl/Cmd to toggle sprint."
- end
- w.Next.MouseButton1Up:wait()
- updateTutorial()
- elseif tuts == 10 then
- if UIS.TouchEnabled then
- t.Text = "To toggle blocking, tap the small gray button on the left. However, blocking costs stamina!"
- else
- t.Text = "For your combat, you can press Q to punch and hold R to block. However, blocking costs stamina!"
- end
- w.Next.MouseButton1Up:wait()
- updateTutorial()
- elseif tuts == 11 then
- t.Text = "Finally, you can charge some spells by holding left click before you release to fire. That's all, have fun!"
- w.Next.Image = "rbxassetid://619804347"
- w.Next.MouseButton1Up:wait()
- updateTutorial()
- elseif tuts == 12 then
- w.Visible = false
- tutorial = false
- player.PlayerGui.Menu.MenuButton.Position = UDim2.new(0, 0, 0.5, 0)
- end
- end
- coroutine.resume(coroutine.create(function()
- if tutorial then
- player.PlayerGui.Menu.MenuButton.Position = UDim2.new(0, -1000, 0, -1000)
- MAIN_GUI.welcome.Visible = true
- MAIN_GUI.welcome.ImageButton.MouseButton1Up:wait()
- MAIN_GUI.welcome.Visible = false
- updateTutorial()
- else
- tuts = 12
- end
- end))
- local function findAttackByKey(key)
- for i, v in next, availableMoves, nil do
- if v.keybind == key then
- return v.move
- end
- end
- end
- local function createSkill(atk)
- local c = MAIN_GUI.Skill:Clone()
- c.BackgroundColor3 = MAGICS[atk.MagicType].ImageColor
- c.Image = TYPE_IMAGES[atk.Type]
- c.ImageColor3 = Color3.new(0, 0, 0)
- c.Visible = true
- return c
- end
- local keybinds = {
- Enum.KeyCode.One,
- Enum.KeyCode.Two,
- Enum.KeyCode.Three,
- Enum.KeyCode.Four,
- Enum.KeyCode.Five
- }
- local prevSelected = 1
- local selectedBind
- local consBind = {}
- function bindKeys()
- for i, v in next, MAIN_GUI.SkillsBar:GetChildren() do
- if v:FindFirstChild("N") then
- v:Destroy()
- end
- end
- for i, v in next, MAIN_GUI.Character.Backpack:GetChildren() do
- if v:FindFirstChild("N") then
- v:Destroy()
- end
- end
- for i, v in next, consBind, nil do
- v:disconnect()
- end
- local Loadout = {}
- for i, atk in next, availableMoves, nil do
- if atk.keybind then
- table.insert(Loadout, {
- Name = atk.move.Name,
- Keybind = atk.keybind
- })
- local c = createSkill(atk.move)
- c.Name = atk.keybind
- c.N.Text = atk.keybind
- c.AnchorPoint = Vector2.new(0.5, 0)
- c.Position = UDim2.new(-0.025 + 0.175 * atk.keybind, 0, 0.1, 0)
- c.Parent = MAIN_GUI.SkillsBar
- c.MouseButton1Up:connect(function()
- selectAttack(atk.keybind, Enum.UserInputState.Begin, {
- KeyCode = atk.keybind
- })
- end)
- game:GetService("ContextActionService"):BindAction(atk.keybind, selectAttack, false, keybinds[atk.keybind], Enum.KeyCode.ButtonR1, Enum.KeyCode.ButtonL1)
- local c2 = c:Clone()
- c2.LayoutOrder = atk.keybind
- c2.Size = UDim2.new(0.7, 0, 0.7, 0)
- c2.Parent = MAIN_GUI.Character.Backpack
- consBind[#consBind + 1] = c2.MouseButton1Up:connect(function()
- if UIS:GetGamepadConnected(Enum.UserInputType.Gamepad1) then
- print("A")
- game:GetService("GuiService").SelectedObject = MAIN_GUI.Frame1.Character
- end
- game:GetService("ContextActionService"):UnbindAction(atk.keybind)
- if selectedBind == atk.keybind then
- selectedBind = nil
- end
- atk.keybind = false
- selectAttack(atk.keybind, Enum.UserInputState.Begin)
- bindKeys()
- end)
- if selectedBind == atk.keybind then
- selectAttack(atk.keybind, Enum.UserInputState.Begin)
- end
- end
- end
- REMOTES.SendLoadout:FireServer(Loadout)
- end
- for i, v in next, MAIN_GUI:WaitForChild("SelectSlot"):WaitForChild("Grid"):GetChildren() do
- if v:IsA("TextButton") then
- v.MouseButton1Up:connect(function()
- if currentMoveSelected then
- for i, v2 in next, availableMoves, nil do
- if v2.keybind and v2.keybind == tonumber(v.Name) then
- v2.keybind = false
- end
- end
- currentMoveSelected.keybind = tonumber(v.Name)
- if UIS:GetGamepadConnected(Enum.UserInputType.Gamepad1) then
- game:GetService("GuiService").SelectedObject = MAIN_GUI.Frame1.Character
- end
- MAIN_GUI.SelectSlot.Position = UDim2.new(0, -1000, 0, 0)
- currentMoveSelected = nil
- bindKeys()
- end
- end)
- end
- end
- local consAv = {}
- local function updateAvailableMoves()
- local old = availableMoves
- availableMoves = {}
- local magicsNumber = 0
- for i, v in next, MAGICS, nil do
- magicsNumber = magicsNumber + 1
- end
- local alreadyScanned = {}
- for i = 1, magicsNumber do
- local proxy = {}
- for n, v in next, _G.PlayersData[player].Data.Magics, nil do
- if MAGICS[n] and MAGICS[n].Index == i and not alreadyScanned[n] then
- alreadyScanned[n] = true
- for i, v2 in next, MAGICS[n].Attacks, nil do
- if v.Unlocked >= v2.Id then
- local old_kb = false
- for i3, v3 in next, old, nil do
- if v3.move.Name == v2.Name then
- old_kb = v3.keybind
- end
- end
- proxy[v2.Id] = {keybind = old_kb, move = v2}
- end
- end
- for i, v2 in next, proxy, nil do
- table.insert(availableMoves, v2)
- end
- end
- end
- end
- for i, v in next, MAIN_GUI.Character.Available.ScrollingFrame.Frame:GetChildren() do
- if not v:IsA("UIComponent") then
- v:Destroy()
- end
- end
- for i, v in next, consAv, nil do
- v:disconnect()
- end
- local p = 0
- local py = 0
- for i, v in next, availableMoves, nil do
- p = p + 1
- if p % 6 == 0 then
- p = 1
- py = py + 1
- end
- do
- local c = createSkill(v.move)
- c.Name = v.move.Name
- c.N.Visible = false
- c.Position = UDim2.new(0, -38 + 52 * p, 0, py * 52)
- local asp = Instance.new("UIAspectRatioConstraint")
- asp.Parent = c
- c.Parent = MAIN_GUI.Character.Available.ScrollingFrame.Frame
- consAv[#consAv + 1] = c.MouseButton1Up:connect(function()
- MAIN_GUI.SelectSlot.Position = UDim2.new(0, mouse.X, 0, mouse.Y)
- if UIS:GetGamepadConnected(Enum.UserInputType.Gamepad1) then
- game:GetService("GuiService").SelectedObject = MAIN_GUI.SelectSlot.Grid["1"]
- end
- currentMoveSelected = v
- end)
- MAIN_GUI.Character.Available.ScrollingFrame.CanvasSize = UDim2.new(0, 0, (1 + py) * 0.333, 0)
- MAIN_GUI.Character.Available.ScrollingFrame.Frame.UIGridLayout.CellSize = UDim2.new(0.19, 0, 1 / (py + 1), -1)
- end
- end
- bindKeys()
- end
- updateAvailableMoves()
- local function GetIndexByName(Name)
- for i, atk in next, availableMoves, nil do
- if atk.move.Name == Name then
- return i
- end
- end
- end
- local Loadout = _G.PlayersData[player].Data.Loadout or {}
- if #Loadout == 0 then
- for i = 1, math.min(5, #availableMoves) do
- availableMoves[i].keybind = i
- end
- else
- for i, v in next, Loadout, nil do
- local Index = GetIndexByName(v.Name)
- if Index then
- availableMoves[Index].keybind = v.Keybind
- end
- end
- end
- local function updateBar()
- for i, v in next, availableMoves, nil do
- if v.keybind and MAIN_GUI.SkillsBar:FindFirstChild(v.keybind) then
- if _G.PlayersData[player].Stunned or _G.BlockedMoves[v.move.Type] or _G.Cooldowns[v.move.Type][3] == true then
- MAIN_GUI.SkillsBar[v.keybind].CD.Text = "..."
- end
- 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
- end
- end
- end
- REMOTES.GetCooldown.OnClientEvent:connect(function(mType, mag, name, b)
- wait(0)
- local num = type(b) == "number"
- _G.Cooldowns[mType] = {
- mag,
- name,
- num and tick() or b
- }
- updateBar()
- end)
- REMOTES.GetBlock.OnClientEvent:connect(function(mType, b)
- wait(0)
- _G.BlockedMoves[mType] = b
- updateBar()
- end)
- function selectAttack(name, state, obj)
- if state == Enum.UserInputState.Begin then
- holding = false
- if obj and obj.UserInputType == Enum.UserInputType.Gamepad1 then
- local val = obj.KeyCode == Enum.KeyCode.ButtonR1 and 1 or -1
- name = tostring(prevSelected % 5 + val)
- if tonumber(name) <= 0 then
- if selectedBind == 5 then
- name = tostring(4)
- else
- name = tostring(5)
- end
- end
- prevSelected = prevSelected + val
- end
- if selectedBind == tonumber(name) then
- for i, v in next, availableMoves, nil do
- if v.keybind and MAIN_GUI.SkillsBar:FindFirstChild(v.keybind) then
- local g = MAIN_GUI.SkillsBar[v.keybind]
- selectedBind = nil
- g.BorderSizePixel = 0
- g:TweenPosition(UDim2.new(-0.025 + 0.175 * v.keybind, 0, 0.1, 0), "Out", "Quad", 0.1, true)
- end
- end
- return
- end
- for i, v in next, availableMoves, nil do
- if v.keybind then
- local g = MAIN_GUI.SkillsBar:FindFirstChild(v.keybind)
- if g then
- if v.keybind == tonumber(name) then
- selectedBind = v.keybind
- g:TweenPosition(UDim2.new(-0.025 + 0.175 * v.keybind, 0, 0.05, 0), "Out", "Quad", 0.1, true)
- g.BorderSizePixel = 2
- else
- g.BorderSizePixel = 0
- g:TweenPosition(UDim2.new(-0.025 + 0.175 * v.keybind, 0, 0.1, 0), "Out", "Quad", 0.1, true)
- end
- end
- end
- end
- end
- end
- local tooltip = MAIN_GUI.Tooltip
- bindKeys()
- mouse.Button1Up:connect(function()
- holding = false
- end)
- mouse.Button1Down:connect(function()
- holding = true
- if MAIN_GUI.SelectSlot.Position.X.Offset > -1000 and not collides(MAIN_GUI.SelectSlot) then
- currentMoveSelected = nil
- MAIN_GUI.SelectSlot.Position = UDim2.new(0, -1000, 0, 0)
- end
- local Magic = findAttackByKey(selectedBind)
- 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
- return
- end
- if _G.PlayersData[player].Mana < Magic.EnergyCost then
- local size = _G.PlayersData[player].Mana / _G.PlayersData[player].MaxMana - Magic.EnergyCost / _G.PlayersData[player].MaxMana
- reqM.Size = UDim2.new(size, 0, 1, 0)
- reqM.Position = UDim2.new(_G.PlayersData[player].Mana / _G.PlayersData[player].MaxMana - size, 0, 0, 0)
- reqM.BackgroundTransparency = 0
- return
- end
- _G.Cooldowns[Magic.Type] = {
- Magic.MagicType,
- Magic.Name,
- true
- }
- if Magic.Type == Enums.MoveType.Ultimate then
- for i = 0, 8 do
- if i ~= Enums.MoveType.Ultimate then
- _G.BlockedMoves[i] = true
- end
- end
- end
- updateBar()
- wait(0)
- Magic:ClientFunction(nil, function(data)
- if UIS.TouchEnabled and selectedBind then
- selectAttack(selectedBind, Enum.UserInputState.Begin)
- end
- return REMOTES.DoMagic:InvokeServer(Magic.MagicType, Magic.Name, data)
- end)
- end)
- function collides(gui)
- local g1p, g1s = gui.AbsolutePosition, gui.AbsoluteSize
- return g1p.x < mouse.X and g1p.x + g1s.x > mouse.X and g1p.y < mouse.Y and g1p.y + g1s.y > mouse.Y
- end
- local proxy = tooltip:Clone()
- proxy.Size = UDim2.new(0, 200, 0, 1000)
- proxy.Position = UDim2.new(0, -1000, 0, 0)
- proxy.Parent = MAIN_GUI
- local bp
- local function bPos(pos)
- local proxy = Instance.new("Part")
- proxy.Transparency = 1
- proxy.Anchored = false
- proxy.CanCollide = false
- proxy.Size = Vector3.new(0.2, 0.2, 0.2)
- local w = Instance.new("Motor6D", proxy)
- w.Part0 = proxy
- w.Part1 = hrp
- local bg = Instance.new("BodyPosition")
- bg.maxForce = Vector3.new(0, 75000, 0)
- bg.position = pos
- bg.Parent = proxy
- proxy.Parent = character
- return {
- aim = function(self, dir)
- bg.position = dir
- end,
- kill = function(self)
- proxy:Destroy()
- end
- }
- end
- local lastKO = 0
- game:GetService("RunService").RenderStepped:connect(function(dt)
- local newMouse = mouse.Hit.p
- _G.ClientsData[player] = {
- Mouse = newMouse,
- Camera = CAMERA.CFrame.p,
- Holding = holding
- }
- for i, v in next, availableMoves, nil do
- local c = _G.Cooldowns[v.move.Type]
- if c and v.keybind and type(c[3]) == "number" and not _G.BlockedMoves[v.move.Type] then
- local d = tick() - c[3]
- if MAGICS[c[1]].Attacks[c[2]].Cooldown - d > 0 then
- MAIN_GUI.SkillsBar[v.keybind].CD.Visible = true
- MAIN_GUI.SkillsBar[v.keybind].CD.Text = math.max(1, math.ceil(MAGICS[c[1]].Attacks[c[2]].Cooldown - d))
- else
- MAIN_GUI.SkillsBar[v.keybind].CD.Visible = false
- end
- end
- end
- updateBar()
- if MAIN_GUI.Book.Visible and MAIN_GUI.Book.InfoFrame.Visible then
- for i, v in next, MAIN_GUI.Book.InfoFrame.Moves:GetChildren() do
- local key, val = string.match(v.Name, "(.+)/(.+)")
- local mg = MAGICS[key]
- if mg and collides(v) then
- local atk = mg.Attacks[val]
- if atk then
- tooltip.Title.Text = atk.Name
- tooltip.Desc.Text = atk.Description
- proxy.Desc.Text = atk.Description
- local size = 30 + proxy.Desc.TextBounds.Y * 1.175
- tooltip.Size = UDim2.new(0, 200, 0, size)
- tooltip.Position = UDim2.new(0, mouse.X + 5, 0, mouse.Y - size - 5)
- tooltip.Visible = true
- break
- end
- else
- tooltip.Visible = false
- end
- end
- elseif MAIN_GUI.Shop.Visible then
- for i, v in next, shopTable, nil do
- local key = string.match(v.Name, "(.+)")
- local mg = robuxshop[key]
- if mg and mg.Name ~= "" and collides(v) then
- tooltip.Title.Text = mg.Name
- tooltip.Desc.Text = mg.Description
- proxy.Desc.Text = mg.Description
- local size = 30 + proxy.Desc.TextBounds.Y * 1.175
- tooltip.Size = UDim2.new(0, 250, 0, size)
- tooltip.Position = UDim2.new(0, mouse.X + 5, 0, mouse.Y + 5)
- tooltip.Visible = true
- break
- else
- tooltip.Visible = false
- end
- end
- else
- for i, v in next, availableMoves, nil do
- if v.keybind and MAIN_GUI.SkillsBar:FindFirstChild(v.keybind) and collides(MAIN_GUI.SkillsBar[v.keybind]) then
- local atk = v.move
- if atk then
- tooltip.Title.Text = atk.Name
- tooltip.Desc.Text = atk.Description
- proxy.Desc.Text = atk.Description
- local size = 30 + proxy.Desc.TextBounds.Y * 1.175
- tooltip.Size = UDim2.new(0, 200, 0, size)
- tooltip.Position = UDim2.new(0, mouse.X + 5, 0, mouse.Y - size - 5)
- tooltip.Visible = true
- break
- end
- 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
- local atk = v.move
- if atk then
- tooltip.Title.Text = atk.Name
- tooltip.Desc.Text = atk.Description
- proxy.Desc.Text = atk.Description
- local size = 30 + proxy.Desc.TextBounds.Y * 1.175
- tooltip.Size = UDim2.new(0, 200, 0, size)
- tooltip.Position = UDim2.new(0, mouse.X + 5, 0, mouse.Y - size - 5)
- tooltip.Visible = true
- break
- end
- else
- tooltip.Visible = false
- end
- end
- end
- local ray = Ray.new(hrp.CFrame.p + Vector3.new(0, 3, 0), Vector3.new(0, -4, 0))
- local hit, pos = workspace:FindPartOnRayWithIgnoreList(ray, {
- character,
- ign[".Attacks"],
- ign[".Floors"],
- ign[".LocalEffects"],
- ign[".ServerEffects"]
- })
- if hit and hit.Name == ".Water" and not bp then
- bp = bPos(pos)
- elseif hit and hit.Name == ".Water" and bp then
- bp:aim(pos)
- elseif not hit and bp then
- bp:kill()
- bp = nil
- end
- if 0 < _G.KO then
- _G.KO = _G.KO - dt
- if 0 > _G.KO then
- _G.KO = 0
- humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
- else
- humanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)
- end
- end
- end)
- local create_party = MAIN_GUI:WaitForChild("CreateParty")
- local members_frame = MAIN_GUI:WaitForChild("MembersFrame")
- local invite_party = MAIN_GUI:WaitForChild("InviteParty")
- local invite_frame = MAIN_GUI:WaitForChild("InviteFrame")
- if workspace:FindFirstChild(".WavesMode") then
- create_party.Visible = false
- end
- local create_id = create_party.Image
- local invite_id = invite_party.Image
- local leave_id = "rbxassetid://571200296"
- local view_id = "rbxassetid://571200340"
- local copy_inv = invite_frame:WaitForChild("ScrollingFrame"):WaitForChild("Copy")
- local inv_lab = copy_inv:Clone()
- copy_inv:Destroy()
- local copy_mem = members_frame:WaitForChild("Frame"):WaitForChild("Copy")
- local mem_lab = copy_mem:Clone()
- copy_mem:Destroy()
- local bup = false
- local inviting = false
- local cur_party = ""
- local my_party = {}
- local cur_info
- local function upd_invites()
- for i, v in next, invite_frame.ScrollingFrame:GetChildren() do
- v:Destroy()
- end
- local ppl = game.Players:GetPlayers()
- invite_frame.ScrollingFrame.CanvasSize = UDim2.new(0, 0, 0, 5 + #ppl * 25)
- for i, v in next, ppl, nil do
- do
- local n = inv_lab:Clone()
- n.Position = UDim2.new(0, 5, 0, 10 + (i - 1) * 25)
- n.Text = v.Name
- if i == 1 then
- n.ImageButton:Destroy()
- else
- do
- local bup2 = false
- n.ImageButton.MouseButton1Up:connect(function()
- if bup or bup2 then
- return
- end
- bup = true
- bup2 = true
- n.ImageButton.Image = "rbxassetid://572347884"
- REMOTES.ManageParty:InvokeServer("Invite", v)
- bup = false
- wait(3)
- bup2 = false
- if n:FindFirstChild("ImageButton") then
- n.ImageButton.Image = "rbxassetid://571048083"
- end
- end)
- end
- end
- n.Parent = invite_frame.ScrollingFrame
- end
- end
- end
- local function upd_party(info)
- cur_info = info
- my_party = info or {}
- if info then
- if cur_party == "" then
- inviting = false
- invite_party.Image = invite_id
- members_frame.Visible = true
- invite_frame.Visible = false
- end
- cur_party = "InParty"
- create_party.Image = leave_id
- if info[1] == player then
- invite_party.Visible = true
- upd_invites()
- else
- invite_party.Visible = false
- end
- for i, v in next, members_frame.Frame:GetChildren() do
- v:Destroy()
- end
- for i, v in next, info, nil do
- do
- local n = mem_lab:Clone()
- n.Name = v.Name
- n.Position = UDim2.new(0, 5, 0, 10 + (i - 1) * 25)
- n.Text = v.Name
- if i == 1 or v == player or info[1] ~= player then
- n.ImageButton:Destroy()
- else
- n.ImageButton.MouseButton1Up:connect(function()
- if bup then
- return
- end
- bup = true
- REMOTES.ManageParty:InvokeServer("Kick", v)
- bup = false
- end)
- end
- n.Parent = members_frame.Frame
- end
- end
- else
- cur_party = ""
- invite_party.Image = view_id
- create_party.Image = create_id
- members_frame.Visible = false
- invite_frame.Visible = false
- invite_party.Visible = false
- end
- end
- create_party.MouseButton1Up:connect(function()
- if bup then
- return
- end
- bup = true
- local todo = cur_party
- if todo == "" then
- inviting = false
- todo = "Create"
- elseif todo == "InParty" then
- todo = "Leave"
- end
- local info = REMOTES.ManageParty:InvokeServer(todo)
- upd_party(info)
- bup = false
- end)
- invite_party.MouseButton1Up:connect(function()
- inviting = not inviting
- invite_party.Image = inviting and view_id or invite_id
- upd_party(cur_info)
- if inviting then
- members_frame.Visible = false
- invite_frame.Visible = true
- else
- members_frame.Visible = true
- invite_frame.Visible = false
- end
- end)
- local cur_invitation
- function REMOTES.ManageParty.OnClientInvoke(k, v)
- if k == "Invite" then
- MAIN_GUI.Invitation.TextLabel.Text = "PARTY INVITATION FROM " .. string.upper(v.Name)
- MAIN_GUI.Invitation.Visible = true
- cur_invitation = v
- elseif k == "Update" then
- upd_party(v)
- elseif k == "RefreshInvitations" then
- upd_invites()
- end
- end
- MAIN_GUI.Invitation.Accept.MouseButton1Up:connect(function()
- if bup then
- return
- end
- bup = true
- local info = REMOTES.ManageParty:InvokeServer("AcceptInvite", cur_invitation)
- upd_party(info)
- MAIN_GUI.Invitation.Visible = false
- bup = false
- end)
- MAIN_GUI.Invitation.Cancel.MouseButton1Up:connect(function()
- MAIN_GUI.Invitation.Visible = false
- end)
- local graph = require(game.ReplicatedStorage.Graph)
- local stats = _G.PlayersData[player].Data.Stats
- local upd, fx = graph.Start(MAIN_GUI.Character.Graph, {
- {
- "Power",
- stats.Power
- },
- {
- "Defense",
- stats.Defense
- },
- {
- "Speed",
- stats.Speed
- },
- {
- "Max Health",
- stats.MaxHP
- },
- {
- "Max Mana",
- stats.MaxMP
- },
- {
- "Max Stamina",
- stats.MaxSP
- }
- }, 100)
- local function updateCharMenu(data)
- data = data or _G.PlayersData[player].Data
- local stats = data.Stats
- MAIN_GUI.Character.Points.Text = "Available skill points: " .. data.Points
- upd({
- {
- "Power",
- stats.Power
- },
- {
- "Defense",
- stats.Defense
- },
- {
- "Speed",
- stats.Speed
- },
- {
- "Max Health",
- stats.MaxHP
- },
- {
- "Max Mana",
- stats.MaxMP
- },
- {
- "Max Stamina",
- stats.MaxSP
- }
- })
- end
- function REMOTES.SpendPoint.OnClientInvoke(data)
- updateCharMenu(data)
- end
- local isVip = false
- coroutine.resume(coroutine.create(function()
- isVip = REMOTES.IsVipServer:InvokeServer()
- end))
- local MarketplaceService = game:GetService("MarketplaceService")
- for i, v in next, shopTable, nil do
- do
- local key = string.match(v.Name, "(.+)")
- local mg = robuxshop[key]
- if mg then
- v.MouseButton1Up:connect(function()
- if mg.ProductId then
- if key == "RainDrop" and isVip then
- return
- end
- MarketplaceService:PromptProductPurchase(player, mg.ProductId)
- else
- MarketplaceService:PromptPurchase(player, mg.PassId)
- end
- end)
- end
- end
- end
- MAIN_GUI.Character.Reset.MouseButton1Up:connect(function()
- MarketplaceService:PromptProductPurchase(player, robuxshop.ResetPoints.ProductId)
- end)
- REMOTES.RefreshCharacterPage.OnClientEvent:connect(function()
- updateCharMenu()
- end)
- MAIN_GUI.Frame1.Character.MouseButton1Up:connect(function()
- if tuts <= 1 then
- return
- end
- if not MAIN_GUI.Character.Visible then
- updateAvailableMoves()
- if selectedBind then
- selectAttack(selectedBind, Enum.UserInputState.Begin)
- end
- updateCharMenu()
- else
- MAIN_GUI.SelectSlot.Position = UDim2.new(0, -1000, 0, 0)
- currentMoveSelected = nil
- bindKeys()
- end
- MAIN_GUI.Character.Visible = not MAIN_GUI.Character.Visible
- if MAIN_GUI.Shop.Visible or MAIN_GUI.Book.Visible then
- MAIN_GUI.Shop.Visible = false
- MAIN_GUI.Book.Visible = false
- end
- if UIS.TouchEnabled then
- game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Chat, not MAIN_GUI.Character.Visible and not MAIN_GUI.Shop.Visible and not MAIN_GUI.Book.Visible)
- end
- end)
- MAIN_GUI.Frame1.Shop.MouseButton1Up:connect(function()
- if tuts <= 1 then
- return
- end
- MAIN_GUI.Shop.Visible = not MAIN_GUI.Shop.Visible
- if MAIN_GUI.Book.Visible or MAIN_GUI.Character.Visible then
- MAIN_GUI.Book.Visible = false
- MAIN_GUI.Character.Visible = false
- end
- if UIS.TouchEnabled then
- game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Chat, not MAIN_GUI.Character.Visible and not MAIN_GUI.Shop.Visible and not MAIN_GUI.Book.Visible)
- end
- end)
- local curSel = false
- local enb = false
- MAIN_GUI.Book.UnlockFrame.Unlock.MouseButton1Up:connect(function()
- if curSel and not enb then
- enb = true
- local suc = REMOTES.UnlockElement:InvokeServer(curSel)
- if suc then
- _G.playSound("PurchaseSuccess")
- updateBookInfo()
- updateBookMagicInfo(not suc, curSel)
- local v
- for i, v2 in next, curSel.Attacks, nil do
- if v2.Id == 1 then
- v = v2
- break
- end
- end
- if v then
- updateAvailableMoves()
- local moveIndex
- local binds = {}
- for i, v2 in next, availableMoves, nil do
- if v2.keybind then
- binds[v2.keybind] = true
- end
- if v2.move.Name == v.Name then
- moveIndex = i
- end
- end
- for i = 1, 5 do
- if not binds[i] then
- binds[i] = true
- availableMoves[moveIndex].keybind = i
- break
- end
- end
- bindKeys()
- end
- else
- _G.playSound("PurchaseFailure")
- end
- enb = false
- end
- end)
- local cac = {
- UDim2.new(0.175, 0, 0, 0),
- UDim2.new(0.65, 0, 0, 0),
- UDim2.new(0.175, 0, 0.35, 0),
- UDim2.new(0.65, 0, 0.35, 0),
- UDim2.new(0.425, 0, 0.7, 0)
- }
- local consBuy = {}
- local buS = false
- function updateBookMagicInfo(locked, info)
- curSel = info
- MAIN_GUI.Book.Title2.Text = info.Name
- MAIN_GUI.Book.InfoFrame.Visible = false
- MAIN_GUI.Book.UnlockFrame.Visible = false
- if locked then
- MAIN_GUI.Book.UnlockFrame.Visible = true
- if info.Fusion then
- MAIN_GUI.Book.UnlockFrame.Unlock.Image = "rbxassetid://567304132"
- MAIN_GUI.Book.UnlockFrame.Diamonds.Visible = false
- for i, v in next, MAIN_GUI.Book.UnlockFrame.Elements:GetChildren() do
- v.Visible = true
- end
- MAIN_GUI.Book.UnlockFrame.Elements.First.Image = MAGICS[info.Fusion[1]].Image
- 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"
- MAIN_GUI.Book.UnlockFrame.Elements.Second.Image = MAGICS[info.Fusion[2]].Image
- 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"
- MAIN_GUI.Book.UnlockFrame.Elements.Second.TextLabel.Visible = true
- MAIN_GUI.Book.UnlockFrame.Elements.Third.Image = info.Image
- if _G.PlayersData[player].Data.Magics[info.Fusion[1]] and _G.PlayersData[player].Data.Magics[info.Fusion[1]].Unlocked >= 5 then
- MAIN_GUI.Book.UnlockFrame.Elements.First.ImageLabel.Visible = true
- else
- MAIN_GUI.Book.UnlockFrame.Elements.First.ImageLabel.Visible = false
- end
- if _G.PlayersData[player].Data.Magics[info.Fusion[2]] and _G.PlayersData[player].Data.Magics[info.Fusion[2]].Unlocked >= 5 then
- MAIN_GUI.Book.UnlockFrame.Elements.Second.ImageLabel.Visible = true
- else
- MAIN_GUI.Book.UnlockFrame.Elements.Second.ImageLabel.Visible = false
- end
- if info.Cost and info.Cost > 0 then
- MAIN_GUI.Book.UnlockFrame.Unlock.Image = "rbxassetid://567304072"
- MAIN_GUI.Book.UnlockFrame.Diamonds.TextLabel.Text = info.Cost or "?"
- MAIN_GUI.Book.UnlockFrame.Diamonds.Visible = true
- end
- else
- for i, v in next, MAIN_GUI.Book.UnlockFrame.Elements:GetChildren() do
- v.Visible = false
- end
- MAIN_GUI.Book.UnlockFrame.Elements.Second.ImageLabel.Visible = false
- MAIN_GUI.Book.UnlockFrame.Elements.Second.TextLabel.Visible = false
- MAIN_GUI.Book.UnlockFrame.Elements.Second.Visible = true
- MAIN_GUI.Book.UnlockFrame.Elements.Second.Image = info.Image
- MAIN_GUI.Book.UnlockFrame.Unlock.Image = "rbxassetid://567304072"
- MAIN_GUI.Book.UnlockFrame.Diamonds.TextLabel.Text = info.Cost or "?"
- MAIN_GUI.Book.UnlockFrame.Diamonds.Visible = true
- end
- else
- for i, v in next, MAIN_GUI.Book.InfoFrame.Moves:GetChildren() do
- if v:IsA("ImageButton") then
- v:Destroy()
- end
- end
- MAIN_GUI.Book.InfoFrame.Visible = true
- for i = 1, 5 do
- local thing = MAIN_GUI.Book.InfoFrame.Moves["b" .. i]
- thing.Visible = false
- end
- for i, v in next, consBuy, nil do
- v:disconnect()
- end
- for i, v in next, info.Attacks, nil do
- do
- local s = createSkill(v)
- s.Name = info.Name .. "/" .. i
- s.Position = cac[v.Id]
- s.Size = UDim2.new(0.2, 0, 0.2, 0)
- local thing = MAIN_GUI.Book.InfoFrame.Moves["b" .. v.Id]
- if _G.PlayersData[player].Data.Magics[info.Name].Unlocked >= v.Id then
- thing.Visible = false
- thing.ImageTransparency = 1
- thing.TextButton.Visible = false
- thing.TextLabel.Visible = false
- thing.Locked.Visible = false
- local img = Instance.new("ImageLabel")
- img.BackgroundTransparency = 1
- img.Image = "rbxassetid://566634511"
- img.Position = UDim2.new(0, 0, 0, 0)
- img.Size = UDim2.new(1, 0, 1, 0)
- img.ZIndex = s.ZIndex + 1
- img.Parent = s
- elseif _G.PlayersData[player].Data.Magics[info.Name].Unlocked + 1 >= v.Id then
- thing.Visible = true
- thing.ImageTransparency = 0
- thing.TextButton.Visible = true
- thing.TextLabel.Visible = true
- thing.TextLabel.Text = v.Cost
- thing.Locked.Visible = false
- consBuy[#consBuy + 1] = thing.TextButton.MouseButton1Up:connect(function()
- if buS then
- return
- end
- buS = true
- local suc = REMOTES.UnlockSpell:InvokeServer(info.Name, v.Name)
- if suc then
- _G.playSound("PurchaseSuccess")
- updateBookInfo()
- updateBookMagicInfo(false, info)
- updateAvailableMoves()
- local moveIndex
- local binds = {}
- for i, v2 in next, availableMoves, nil do
- if v2.keybind then
- binds[v2.keybind] = true
- end
- if v2.move.Name == v.Name then
- moveIndex = i
- end
- end
- for i = 1, 5 do
- if not binds[i] then
- binds[i] = true
- availableMoves[moveIndex].keybind = i
- break
- end
- end
- bindKeys()
- else
- _G.playSound("PurchaseFailure")
- end
- buS = false
- end)
- else
- thing.Visible = true
- thing.ImageTransparency = 1
- thing.TextButton.Visible = false
- thing.TextLabel.Visible = false
- thing.Locked.Visible = true
- end
- s.Parent = MAIN_GUI.Book.InfoFrame.Moves
- end
- end
- MAIN_GUI.Book.InfoFrame.Moves.Visible = true
- end
- end
- local consBook = {}
- function updateBookInfo()
- for i, v in next, consBook, nil do
- v:disconnect()
- end
- MAIN_GUI.Book.Scroll.CanvasSize = UDim2.new(0, 0, 0, 0)
- for i, v in next, MAIN_GUI.Book.Scroll:GetChildren() do
- if v.Name ~= "CloneFrame" and not v:IsA("UIComponent") then
- v:Destroy()
- end
- end
- local subIndex = 1
- for i, v in next, MAGICS, nil do
- do
- local hidden = false
- hidden = hidden or i == "Sans" and not _G.PlayersData[player].Data.Magics[i]
- if not hidden then
- end
- if 0 < v.Index and not hidden then
- local locked = tutorial == false and not _G.PlayersData[player].Data.Magics[i] or tutorial and v.Index > 3
- local f = MAIN_GUI.Book.Scroll.CloneFrame:Clone()
- f.Name = i .. "Frame"
- f.Visible = true
- f.LayoutOrder = v.Index
- f.Icon.Image = v.Image
- f.Button.Text = i
- f.Icon.ImageColor3 = locked and Color3.new() or Color3.new(1, 1, 1)
- f.Button.TextStrokeColor3 = locked and Color3.new() or v.ImageColor:lerp(Color3.new(), 0.2)
- if locked then
- local img = Instance.new("ImageLabel")
- img.BackgroundTransparency = 1
- img.Image = "rbxassetid://566840786"
- img.Position = UDim2.new(0, -9, 0, -9)
- img.Size = UDim2.new(1, 14, 1, 14)
- img.ZIndex = f.ZIndex + 1
- img.Parent = f.Icon
- end
- consBook[#consBook + 1] = f.Button.MouseButton1Up:connect(function()
- updateBookMagicInfo(not _G.PlayersData[player].Data.Magics[i], v)
- end)
- consBook[#consBook + 1] = f.Icon.MouseButton1Up:connect(function()
- updateBookMagicInfo(not _G.PlayersData[player].Data.Magics[i], v)
- end)
- f.Parent = MAIN_GUI.Book.Scroll
- end
- end
- end
- local amountOfMagics = 0
- for _, v in pairs(MAIN_GUI.Book.Scroll:GetChildren()) do
- if v:IsA("Frame") and v.Visible then
- amountOfMagics = amountOfMagics + 1
- end
- end
- MAIN_GUI.Book.Scroll.CanvasSize = UDim2.new(0, 0, 0.15 * amountOfMagics, 0)
- MAIN_GUI.Book.Scroll.UIGridLayout.CellSize = UDim2.new(1, 0, 1 / amountOfMagics, -1)
- end
- MAIN_GUI.Frame1.Book.MouseButton1Up:connect(function()
- if tuts <= 1 then
- return
- end
- if not MAIN_GUI.Book.Visible then
- updateBookInfo()
- end
- MAIN_GUI.Book.Visible = not MAIN_GUI.Book.Visible
- if MAIN_GUI.Shop.Visible or MAIN_GUI.Character.Visible then
- MAIN_GUI.Shop.Visible = false
- MAIN_GUI.Character.Visible = false
- end
- if UIS.TouchEnabled then
- game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Chat, not MAIN_GUI.Character.Visible and not MAIN_GUI.Shop.Visible and not MAIN_GUI.Book.Visible)
- end
- end)
- local Touch_Tick = tick()
- function touchy(h)
- if not h.Parent then
- return
- end
- if h.Parent.Name == "Increase Cap" then
- print(expNeeded(_G.PlayersData[player].Data.Level), _G.PlayersData[player].Data.Level)
- end
- 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
- MAIN_GUI.increase.Visible = true
- end
- end
- hrp.Touched:connect(touchy)
- MAIN_GUI:WaitForChild("increase"):WaitForChild("Accept").MouseButton1Up:connect(function()
- MAIN_GUI.increase.Visible = false
- REMOTES.IncreaseCap:FireServer()
- end)
- MAIN_GUI:WaitForChild("increase"):WaitForChild("Cancel").MouseButton1Up:connect(function()
- MAIN_GUI.increase.Visible = false
- end)
- local shakeStart = 0
- local shakeDuration = 0
- local shakeIntensity = 0
- function _G.ShakeCamera(intensity, duration)
- shakeStart = tick()
- shakeDuration = math.clamp(shakeDuration + 1, 0, 8)
- shakeIntensity = math.clamp(shakeIntensity + intensity, 0, 10)
- end
- local multiplier = 0.016666666666666666
- local speedrequired = 120
- local notShard, notDiamond, notSafe
- local prevData = _G.PlayersData[player]
- if not prevData then
- repeat
- prevData = _G.PlayersData[player]
- wait(0)
- until prevData
- end
- local lastBlock = false
- local startF = tick()
- local lastTick = tick()
- while wait(0) do
- local delta = tick() - lastTick
- local my = _G.PlayersData[player]
- if tick() - startF > 3 then
- REMOTES.ClientData:FireServer(_G.ClientsData[player])
- end
- hb.TextLabel.Text = "HEALTH (" .. math.ceil(humanoid.Health * 10) .. "/" .. math.ceil(humanoid.MaxHealth * 10) .. ")"
- hb.Empty.Size = UDim2.new(1 - humanoid.Health / humanoid.MaxHealth, 0, 1, 0)
- hb.Empty.Position = UDim2.new(humanoid.Health / humanoid.MaxHealth, 0, 0, 0)
- eb.TextLabel.Text = "MANA (" .. math.ceil(my.Mana * 10) .. "/" .. math.ceil(my.MaxMana * 10) .. ")"
- 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)
- sb.TextLabel.Text = "STAMINA (" .. math.ceil(my.Stamina * 10) .. "/" .. math.ceil(my.MaxStamina * 10) .. ")"
- 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)
- reqM.BackgroundTransparency = reqM.BackgroundTransparency + delta
- reqM2.BackgroundTransparency = reqM2.BackgroundTransparency + delta
- lvl.Text = "Lvl. " .. my.Data.Level
- exp.Empty.Size = UDim2.new(1 - my.Data.Exp / expNeeded(my.Data.Level), 0, 1, 0)
- exp.Empty.Position = UDim2.new(my.Data.Exp / expNeeded(my.Data.Level), 0, 0, 0)
- exp.TextLabel.Text = "EXP: " .. my.Data.Exp .. "/" .. expNeeded(my.Data.Level)
- shards.TextLabel.Text = my.Data.Shards
- diamonds.TextLabel.Text = my.Data.Diamonds
- if my.Stamina <= 0 then
- my.Running = false
- _G.running = false
- elseif my.Blocking and _G.Blocking and lastBlock == false then
- lastBlock = true
- _G.PlayAnim("Block", 0.5, 10, 0.01)
- elseif not my.Blocking and lastBlock == true then
- lastBlock = false
- _G.StopAnim("Block", 0.5)
- _G.Blocking = false
- end
- humanoid.WalkSpeed = (_G.running and 32 or 16) * my.SpeedMultiplier * (0.6 + humanoid.Health / humanoid.MaxHealth * 0.4)
- local velocity = hrp.Velocity
- if shakeDuration <= 0 and velocity.y < -speedrequired then
- local ray = Ray.new(hrp.CFrame.p, Vector3.new(0, -math.abs(velocity.y / 12), 0))
- local hit, pos = workspace:FindPartOnRayWithIgnoreList(ray, {character})
- if hit then
- if hit.Parent.Name == ".Water" then
- hrp.Velocity = hrp.Velocity - Vector3.new(0, hrp.Velocity.y / 2, 0)
- _G.playSound("WaterSplash", hrp)
- else
- _G.ShakeCamera(-velocity.y * multiplier, -velocity.y * multiplier * 0.5)
- _G.playSound("GroundCrash", hrp)
- end
- end
- end
- if shakeDuration > 0 and shakeStart > 0 then
- humanoid.CameraOffset = Vector3.new(shakeIntensity * math.random() - shakeIntensity / 2, shakeIntensity * math.random() - shakeIntensity / 2, shakeIntensity * math.random() - shakeIntensity / 2) * shakeDuration
- shakeDuration = shakeDuration - delta
- elseif shakeIntensity < 0 or shakeDuration < 0 then
- shakeIntensity = 0
- shakeDuration = 0
- humanoid.CameraOffset = Vector3.new()
- end
- if MAIN_GUI.Character.Visible then
- fx()
- end
- if prevData.Data.Shards - my.Data.Shards ~= 0 then
- do
- local diff = my.Data.Shards - prevData.Data.Shards
- local txt = diff > 0 and "+" .. diff or diff
- if notShard then
- do
- local d = notShard
- d:TweenPosition(UDim2.new(0.5, -140, 0, -75), "In", "Quad", 0.5, true, function()
- d:Destroy()
- end)
- notShard = nil
- end
- end
- local n = MAIN_GUI.NotifyShard:Clone()
- n.Position = UDim2.new(0.5, -180, 0, -75)
- n.TextLabel.Text = txt
- notShard = n
- n.Parent = MAIN_GUI
- n:TweenPosition(UDim2.new(0.5, -180, 0.075, 10), "Out", "Quad", 0.5, true, function()
- wait(2)
- if notShard == n then
- notShard = nil
- n:TweenPosition(UDim2.new(0.5, -180, 0, -75), "In", "Quad", 0.5, true, function()
- n:Destroy()
- end)
- end
- end)
- end
- end
- if prevData.Data.Diamonds - my.Data.Diamonds ~= 0 then
- do
- local diff = my.Data.Diamonds - prevData.Data.Diamonds
- local txt = diff > 0 and "+" .. diff or diff
- if notDiamond then
- do
- local d = notDiamond
- d:TweenPosition(UDim2.new(0.5, 20, 0, -75), "In", "Quad", 0.5, true, function()
- d:Destroy()
- end)
- notDiamond = nil
- end
- end
- local n = MAIN_GUI.NotifyDiamond:Clone()
- n.Position = UDim2.new(0.5, 60, 0, -75)
- n.TextLabel.Text = txt
- notDiamond = n
- n.Parent = MAIN_GUI
- n:TweenPosition(UDim2.new(0.5, 60, 0.075, 10), "Out", "Quad", 0.5, true, function()
- wait(2)
- if notDiamond == n then
- notDiamond = nil
- n:TweenPosition(UDim2.new(0.5, 60, 0, -75), "In", "Quad", 0.5, true, function()
- n:Destroy()
- end)
- end
- end)
- end
- end
- local safe = false
- for i, v in next, safezones, nil do
- if (v.pos - hrp.Position).magnitude < v.radius then
- safe = true
- break
- end
- end
- _G.safezoned = safe
- MAIN_GUI.Safezone.Visible = _G.safezoned
- for i, v in next, my_party, nil do
- local char = v.Character
- if char then
- local hum = char:FindFirstChild("Humanoid")
- local phrp = char:FindFirstChild("HumanoidRootPart")
- local phead = char:FindFirstChild("Head")
- if hum then
- for i2, v2 in next, members_frame.Frame:GetChildren() do
- if v.Name == v2.Name then
- v2.Frame.Frame.Size = UDim2.new(hum.Health / hum.MaxHealth, 0, 1, 0)
- end
- end
- end
- end
- end
- prevData = my
- lastTick = tick()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement