--- Skill

repeat wait() until game.Players.LocalPlayer.Character

local plr = game.Players.LocalPlayer
local char = plr.Character
local hum = char:WaitForChild("Humanoid")
local Torso = char:WaitForChild("LowerTorso")
local Mouse = plr:GetMouse()
local toggle = false
local Debounce = true
Mouse.KeyDown:Connect(function(key)
    if key == "f" and Tool.Equip.Value == true and Tool.Active.Value == "None" or Tool.Active.Value == "SunaFlight" then
        if toggle == false and Debounce == true then
            toggle = true
            local Anim = Instance.new("Animation")
            Anim.AnimationId = "rbxassetid://4865646330"
            local PlayAnim = hum:LoadAnimation(Anim)
            PlayAnim:Play()
            Debounce = false
            Tool.Active.Value = "SunaFlight"
		    script.Fire:FireServer(plr)
            local BV = Instance.new("BodyVelocity",Torso)
            BV.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
            while toggle == true do
                wait()
            plr.Character.HumanoidRootPart.CFrame = CFrame.new(plr.Character.HumanoidRootPart.Position, Vector3.new(Mouse.Hit.p.x,plr.Character.HumanoidRootPart.Position.y,Mouse.Hit.p.z))
            BV.Velocity = Mouse.Hit.lookVector * 110
            end
        end
        if toggle == true and Debounce == false then
            toggle = false
            Tool.Active.Value = "None"
            script.UnFire:FireServer(plr)
            Torso:FindFirstChildOfClass("BodyVelocity"):Destroy()
            local tracks = hum:GetPlayingAnimationTracks()
            for i, stoptracks in pairs(tracks) do
            stoptracks:Stop()
            end
            local Anim = Instance.new("Animation")
            Anim.AnimationId = "http://www.roblox.com/asset/?id=507767968"
            local PlayAnim = hum:LoadAnimation(Anim)
            PlayAnim:Play()
            wait(3.5)
            Debounce = true
        end
    end
end)
