Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- params : ...
- while 1 do
- if game.Players.LocalPlayer.Character == nil or game.Players.LocalPlayer.Character.Parent == nil or game.Players.LocalPlayer.Character:findFirstChild("Health") == nil or game.Players.LocalPlayer.Character.Health:IsA("IntValue") == false then
- wait(0.1)
- -- DECOMPILER ERROR at PC35: LeaveBlock: unexpected jumping out IF_THEN_STMT
- -- DECOMPILER ERROR at PC35: LeaveBlock: unexpected jumping out IF_STMT
- end
- end
- wait()
- game.StarterGui:SetCoreGuiEnabled(0, false)
- game.StarterGui:SetCoreGuiEnabled(1, false)
- game.StarterGui:SetCoreGuiEnabled(2, false)
- local keys = {}
- local player = game.Players.LocalPlayer
- local mouse = (player:GetMouse())
- local bv, bg = nil, nil
- local animations = {}
- local flying = false
- local state = "Hover"
- local wTable = nil
- local lastSpace = 0
- local speed = 0
- local lastFly = -1.5
- local cam = game.Workspace.CurrentCamera
- local resources = game.ReplicatedStorage.Resources
- local wingModule = require(game.ReplicatedStorage.Resources.Libraries.Wings)
- local skillModule = require(game.ReplicatedStorage.Resources.Libraries.Skills)
- local common = require(game.ReplicatedStorage.Resources.Libraries.CommonMethods)
- local profile = common.GetProfile(player)
- skillModule.Initialize(animations)
- player.NameDisplayDistance = 0
- player.HealthDisplayDistance = 0
- player.CameraMaxZoomDistance = 50
- local action = false
- local slashDB = false
- local skill = "None"
- local swordAnims = {"SpinSlash", "DoubleSlash"}
- SetupCharacter = function(char)
- while 1 do
- if char:findFirstChild("HumanoidRootPart") == nil or player.Character.HumanoidRootPart:findFirstChild("BodyGyro") == nil then
- wait(1)
- -- DECOMPILER ERROR at PC16: LeaveBlock: unexpected jumping out IF_THEN_STMT
- -- DECOMPILER ERROR at PC16: LeaveBlock: unexpected jumping out IF_STMT
- end
- end
- if profile.Wings.Value == "None" then
- profile.Wings.Value = profile.Class.Value
- end
- wTable = wingModule.AttachWings(player, game.ReplicatedStorage.Profiles[player.Name].Wings.Value)
- bv = player.Character.HumanoidRootPart:findFirstChild("BodyVelocity")
- bv.maxForce = Vector3.new(0, 0, 0)
- bv.velocity = Vector3.new(0, 0, 0)
- bg = player.Character.HumanoidRootPart:findFirstChild("BodyGyro")
- bg.maxTorque = Vector3.new(0, 0, 0)
- LoadAnimations()
- end
- mouse.KeyDown:connect(function(k)
- if keys[k:lower()] ~= nil then
- keys[k:lower()] = true
- else
- keys[k:lower()] = true
- end
- if k == " " then
- if flying == false and time() - lastSpace < 0.5 and time() - lastFly > 1.5 and (game.ReplicatedStorage:findFirstChild("CanFly") == nil or game.ReplicatedStorage.CanFly.Value == true) then
- flying = true
- bv.maxForce = Vector3.new(math.huge, math.huge, math.huge)
- bg.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
- player.Character.Humanoid.PlatformStand = true
- wTable.animation = wingModule.animations.Hover
- game.ReplicatedStorage.FlightHandler:FireServer("Flying")
- animations.LegRaise:Play()
- animations.FlightArms:Play()
- animations.SwordIdle:Stop()
- else
- if flying == true then
- flying = false
- lastFly = time()
- bv.maxForce = Vector3.new(0, 0, 0)
- bg.maxTorque = Vector3.new(0, 0, 0)
- player.Character.Humanoid.PlatformStand = false
- wTable.animation = wingModule.animations.Idle
- game.ReplicatedStorage.FlightHandler:FireServer("None")
- animations.LegRaise:Stop()
- animations.FlightArms:Stop()
- if IsEquipped() then
- animations.SwordIdle:Play()
- end
- end
- end
- lastSpace = time()
- end
- for i,v in pairs(profile.Skills:GetChildren()) do
- if v.Value == k:lower() then
- skillModule.UseSkill(v.Name)
- end
- end
- end)
- mouse.KeyUp:connect(function(k)
- if keys[k:lower()] ~= nil then
- keys[k:lower()] = false
- else
- keys[k:lower()] = false
- end
- end)
- local action2 = false
- mouse.Button1Down:connect(function()
- if action == false and action2 == false and IsEquipped() and slashDB == false then
- game.ReplicatedStorage.DamageHandler:FireServer("Damage")
- action = true
- action2 = true
- local swing = swordAnims[math.random(1, #swordAnims)]
- animations[swing]:Play()
- local blade = player.Character.Weapon.Blade
- wait(0.8)
- animations[swing]:Stop()
- wait(0.05)
- slashDB = false
- action = false
- wait(0.05)
- action2 = false
- end
- end)
- LoadAnimations = function()
- for i,v in pairs(game.ReplicatedStorage.Resources.Animations:GetChildren()) do
- animations[v.Name] = player.Character.Humanoid:LoadAnimation(v)
- end
- end
- IsEquipped = function()
- if player.Character:findFirstChild("Weapon") ~= nil and player.Character.Weapon.Arm.WeaponWeld.Part0.Name == "Right Arm" then
- return true
- end
- return false
- end
- SetupShops = function(w)
- for i,v in pairs(w:GetChildren()) do
- if v.Name == "ALO_ItemBuy" then
- local gui = v.SurfaceGui.Frame
- do
- gui.Buy.MouseButton1Click:connect(function()
- print(game.ReplicatedStorage.EquipmentHandler:InvokeServer("Buy", gui))
- end)
- local item = game.ReplicatedStorage.Resources.Items[gui.ItemName.Value]
- gui.ItemLabel.Text = "[Lv." .. tostring(item.Level.Value) .. "]" .. item.Name
- gui.PriceLabel.Text = "Col." .. tostring(gui.Price.Value)
- if item.Stats:FindFirstChild("Melee") then
- gui.Melee.Text = "Melee: " .. tostring(item.Stats.Melee.Value)
- else
- if item.Stats:FindFirstChild("Defense") then
- gui.Melee.Text = "Defense: " .. tostring(item.Stats.Defense.Value)
- end
- end
- gui.Magic.Text = "Magic: " .. tostring(item.Stats.Magic.Value)
- end
- else
- do
- do
- if v:IsA("Model") then
- SetupShops(v)
- end
- -- DECOMPILER ERROR at PC92: LeaveBlock: unexpected jumping out DO_STMT
- -- DECOMPILER ERROR at PC92: LeaveBlock: unexpected jumping out IF_ELSE_STMT
- -- DECOMPILER ERROR at PC92: LeaveBlock: unexpected jumping out IF_STMT
- end
- end
- end
- end
- end
- FlyControls = function()
- local hoverCounter = 0
- coroutine.resume(coroutine.create(function()
- while 1 do
- while 1 do
- while 1 do
- while 1 do
- while 1 do
- while 1 do
- while 1 do
- while 1 do
- while 1 do
- while 1 do
- if wait(0.1) then
- if flying then
- if state == "Hover" then
- if speed < 55 then
- wTable.animSpeed = 0.08
- if hoverCounter <= 2 then
- wTable.animation = wingModule.animations.Hover
- else
- if hoverCounter <= 4 then
- wTable.animation = wingModule.animations.HoverBack
- else
- hoverCounter = -1
- end
- end
- hoverCounter = hoverCounter + 1
- else
- wTable.animSpeed = 0.04
- wTable.animation = wingModule.animations.Dive
- end
- end
- if skillModule.casting then
- bg.cframe = mouse.Hit
- else
- bg.cframe = cam.CoordinateFrame
- end
- local maxWSpeed = 52
- local maxADSpeed = 45
- local maxSSpeed = -45
- if keys.w then
- if speed < maxWSpeed then
- speed = maxWSpeed
- else
- if player.Character.HumanoidRootPart.Velocity.Y < -10 then
- speed = speed - player.Character.HumanoidRootPart.Velocity.unit.Y * 2
- else
- if maxWSpeed < speed then
- local add = speed - maxWSpeed
- add = add * 0.9
- speed = maxWSpeed + add
- else
- do
- speed = speed - player.Character.HumanoidRootPart.Velocity.unit.Y * 3
- if speed < 55 then
- bg.cframe = bg.cframe * CFrame.Angles(-0.6, 0, 0)
- else
- bg.cframe = bg.cframe * CFrame.Angles(-1.2, 0, 0)
- end
- if not keys.a and not keys.d then
- bv.velocity = cam.CoordinateFrame.lookVector * speed
- -- DECOMPILER ERROR at PC150: LeaveBlock: unexpected jumping out IF_THEN_STMT
- -- DECOMPILER ERROR at PC150: LeaveBlock: unexpected jumping out IF_STMT
- -- DECOMPILER ERROR at PC150: LeaveBlock: unexpected jumping out DO_STMT
- -- DECOMPILER ERROR at PC150: LeaveBlock: unexpected jumping out IF_ELSE_STMT
- -- DECOMPILER ERROR at PC150: LeaveBlock: unexpected jumping out IF_STMT
- -- DECOMPILER ERROR at PC150: LeaveBlock: unexpected jumping out IF_ELSE_STMT
- -- DECOMPILER ERROR at PC150: LeaveBlock: unexpected jumping out IF_STMT
- -- DECOMPILER ERROR at PC150: LeaveBlock: unexpected jumping out IF_ELSE_STMT
- -- DECOMPILER ERROR at PC150: LeaveBlock: unexpected jumping out IF_STMT
- -- DECOMPILER ERROR at PC150: LeaveBlock: unexpected jumping out IF_THEN_STMT
- -- DECOMPILER ERROR at PC150: LeaveBlock: unexpected jumping out IF_STMT
- -- DECOMPILER ERROR at PC150: LeaveBlock: unexpected jumping out IF_THEN_STMT
- -- DECOMPILER ERROR at PC150: LeaveBlock: unexpected jumping out IF_STMT
- -- DECOMPILER ERROR at PC150: LeaveBlock: unexpected jumping out IF_THEN_STMT
- -- DECOMPILER ERROR at PC150: LeaveBlock: unexpected jumping out IF_STMT
- end
- end
- end
- end
- end
- end
- end
- end
- end
- if keys.a then
- bg.cframe = bg.cframe * CFrame.Angles(0, -0.4, 0)
- bv.velocity = cam.CoordinateFrame * CFrame.Angles(0, 0.785, 0).lookVector * speed
- -- DECOMPILER ERROR at PC180: LeaveBlock: unexpected jumping out IF_THEN_STMT
- -- DECOMPILER ERROR at PC180: LeaveBlock: unexpected jumping out IF_STMT
- end
- end
- if keys.d then
- bg.cframe = bg.cframe * CFrame.Angles(0, 0.4, 0)
- bv.velocity = cam.CoordinateFrame * CFrame.Angles(0, -0.785, 0).lookVector * speed
- end
- end
- if keys.s then
- if speed >= 0 then
- speed = -30
- end
- bg.cframe = bg.cframe * CFrame.Angles(0.5, 0, 0)
- if not keys.a and not keys.d then
- bv.velocity = cam.CoordinateFrame.lookVector * speed
- -- DECOMPILER ERROR at PC246: LeaveBlock: unexpected jumping out IF_THEN_STMT
- -- DECOMPILER ERROR at PC246: LeaveBlock: unexpected jumping out IF_STMT
- -- DECOMPILER ERROR at PC246: LeaveBlock: unexpected jumping out IF_THEN_STMT
- -- DECOMPILER ERROR at PC246: LeaveBlock: unexpected jumping out IF_STMT
- end
- end
- end
- if keys.a then
- bg.cframe = bg.cframe * CFrame.Angles(0, 0, 0.4)
- bv.velocity = cam.CoordinateFrame * CFrame.Angles(0, -0.785, 0).lookVector * speed
- -- DECOMPILER ERROR at PC276: LeaveBlock: unexpected jumping out IF_THEN_STMT
- -- DECOMPILER ERROR at PC276: LeaveBlock: unexpected jumping out IF_STMT
- end
- end
- if keys.d then
- bg.cframe = bg.cframe * CFrame.Angles(0, 0, -0.4)
- bv.velocity = cam.CoordinateFrame * CFrame.Angles(0, 0.785, 0).lookVector * speed
- end
- end
- if keys.a then
- speed = maxADSpeed
- bg.cframe = bg.cframe * CFrame.Angles(0, 0, 0.4)
- bv.velocity = cam.CoordinateFrame * CFrame.Angles(0, 1.57, 0).lookVector * speed
- -- DECOMPILER ERROR at PC337: LeaveBlock: unexpected jumping out IF_THEN_STMT
- -- DECOMPILER ERROR at PC337: LeaveBlock: unexpected jumping out IF_STMT
- end
- end
- if keys.d then
- speed = maxADSpeed
- bg.cframe = bg.cframe * CFrame.Angles(0, 0, -0.4)
- bv.velocity = cam.CoordinateFrame * CFrame.Angles(0, -1.57, 0).lookVector * speed
- -- DECOMPILER ERROR at PC368: LeaveBlock: unexpected jumping out IF_THEN_STMT
- -- DECOMPILER ERROR at PC368: LeaveBlock: unexpected jumping out IF_STMT
- end
- end
- speed = 0
- if not keys.a and not keys.w and not keys.s and not keys.d and hoverCounter <= 4 then
- bv.velocity = cam.CoordinateFrame.lookVector * speed + Vector3.new(0, 0, 0)
- -- DECOMPILER ERROR at PC404: LeaveBlock: unexpected jumping out IF_THEN_STMT
- -- DECOMPILER ERROR at PC404: LeaveBlock: unexpected jumping out IF_STMT
- end
- end
- bv.velocity = cam.CoordinateFrame.lookVector * speed + Vector3.new(0, 0, 0)
- end
- end))
- end
- player.CharacterAdded:connect(SetupCharacte)
- if player.Character ~= nil then
- SetupCharacter(player.Characte)
- end
- player.Character.ChildAdded:connect(function(c)
- wait()
- if c.Name == "Weapon" then
- animations.SwordIdle:Play()
- c.Arm.WeaponWeld.Changed:connect(function()
- -- DECOMPILER ERROR at PC28: Unhandled construct in 'MakeBoolean' P1
- if c ~= nil and c:findFirstChild("Arm") ~= nil and c.Arm.WeaponWeld.Part0 ~= nil and c.Arm.WeaponWeld.Part0.Name == "Torso" and not flying then
- animations.SwordIdle:Stop()
- end
- if not flying then
- animations.SwordIdle:Play()
- end
- end)
- end
- end)
- game.Workspace.ChildAdded:connect(function(c)
- wait(1)
- if game.Players:findFirstChild(c.Name) ~= nil then
- wingModule.SetupCharacters()
- end
- end)
- if game:GetService("ReplicatedStorage):FindFirstChild("CanFly) ~= nil then
- game:GetService("ReplicatedStorage).CanFly.Value = false
- game:GetService("ReplicatedStorage).CanFly.Changed:connect(function()
- game:GetService("ReplicatedStorage").CanFly.Value = false
- end)
- end
- game.Workspace.Changed:Connect(function(ee)
- if ee == "Gravity" then
- workspace.Gravity = 196.2
- end
- end)
- wingModule.SetupCharacters()
- SetupShops(workspac)
- FlyControls()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement