function wait(t)
 	local start = os.time() + t/10
 	repeat until os.time() > start
end

--LOCALSCRIPT--

--// SERVICES \\--

for fov = 1, 20 do
    print(fov)
    wait(1/fov)
end

local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local UserInputService = game:GetService("UserInputService")
local Debris = game:GetService("Debris")

local KeyCode = Enum.KeyCode
local UserInputType = Enum.UserInputType

--// Tool Settings \\--

local Tool = script.Parent.Parent
local Type = Tool:GetAttribute("Type")

--// Folders \\--

local Animations = ReplicatedStorage:WaitForChild("Animations")
local Remotes = ReplicatedStorage:WaitForChild("Remotes")
local AbilityAnimations = Animations:WaitForChild("AbilityAnimations")


local AnimationFolderNeeded = AbilityAnimations:FindFirstChild(Type)
local RemoteFolderNeeded = Remotes:FindFirstChild(Type)

--// EXTRAS \\--

local RunningAnimation = AnimationFolderNeeded:FindFirstChild("RunningAnimation")
local AbilityAnimation = AnimationFolderNeeded:FindFirstChild("RunningSkill")

local AbilityRemote = RemoteFolderNeeded:FindFirstChild("RunningSkill")

local Character = Tool.Parent or Tool.Parent:IsA("Model")

local Player = Players:GetPlayerFromCharacter(Character)

UserInputService.InputBegan:Connect(function(input, isTyping)
    if isTyping then
        return
    end

    if input.KeyCode == KeyCode.Z then
        AbilityRemote:FireServer(Player, RunningAnimation, AbilityAnimation, Tool)
    end
end)

--script--

--// SERVICES \\--

local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local UserInputService = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")
local Debris = game:GetService("Debris")
local Camera = Workspace:FindFirstChild("Camera")

--// EXTRAS \\--

local tweenInfo = {
    2, --Time
    ES.Quad, --EasingStyle
    ED.InOut, --EasingDirection
    0,
    false,
    0,
}

local ES = Enum.EasingStyle
local ED = Enum.EasingDirection

local AbilityHitboxFolder = Workspace:FindFirstChild("AbilityHitboxFolder")
local Modules = ReplicatedStorage:FindFirstChild("Modules")

local TomatoHitbox = require(Modules:FindFirstChild("TomatoHitbox"))

local Assets = ReplicatedStorage:WaitForChild("Assets")
local Animations = ReplicatedStorage:WaitForChild("Animations")
local Remotes = ReplicatedStorage:WaitForChild("Remotes")

local RunningSlash = Assets:FindFirstChild("Katana"):FindFirstChild("RunningSlash")
local RunningSkill = Remotes:FindFirstChild("Katana"):FindFirstChild("RunningSkill")

RunningSkill.OnServerEvent:Connect(function(plr, runninganimation, abilityanimation, tool)

    --// CHARACTER \\--
    
    local Character = plr.Character or plr.CharacterAdded:Wait()
    local Humanoid = Character:FindFirstChild("Humanoid")
    local Animator = Humanoid:WaitForChild("Animator")
    
    local HumanoidRootPart = Character:FindFirstChild("HumanoidRootPart")
    local Torso = Character:FindFirstChild("Torso")

    --// TOOL \\--

    local dmg = tool:GetAttribute("Damage")
    local color = tool:GetAttribute("Color")
    
    --// HITBOX \\--

    local hitbox = TomatoHitbox.new()
    hitbox.Size = Vector3.new(6, 6, 6)
    hitbox.CFrame = HumanoidRootPart
    hitbox.Offset = CFrame.new(0, 0, -4)
    hitbox.Parent = AbilityHitboxFolder
    hitbox.Visualizer = true --Visualizer = true means its Visible

    --// ANIMATIONS \\--
    
    local RunningAnimationTrack = Animator:LoadAnimation(runninganimation)
    local SlashAnimationTrack = Animator:LoadAnimation(abilityanimation)
    
    
--[[
    hitbox:Start()
    hitbox:Stop()
    hitbox:Destroy()

    hitbox.onTouch = function(eHum)

    if eHum.Name == "Enemy" then
]]
    
    local orignalWalkspeed = Humanoid.WalkSpeed
    local originalFOV = Camera.FieldOfView

    local hitboxTouched = false

    RunningAnimationTrack:Play()

    for i = 1, 25 do
        Camera.FieldOfView = Camera.FieldOfView + i
        Humanoid.WalkSpeed = Humanoid.WalkSpeed + i
        HumanoidRootPart.CFrame = Torso.CFrame + (Torso.CFrame.LookVector * i)

        hitbox:Start()

        if i >= 15 then

            local Attachment0 = Instance.new("Attachment", HumanoidRootPart)
            
            Attachment0.Name = "Attachment0"
            Attachment0.CFrame = Torso.CFrame
            
            
            local Attachment1 = Instance.new("Attachment", HumanoidRootPart)
            
            Attachment1.Name = "Attachment1"
            Attachment1.CFrame = Torso.CFrame + CFrame.new(0, 0, -4)
            
                
            local Trail = Instance.new("Trail", HumanoidRootPart)
            
            Trail.Attachment0 = Attachment0
            Trail.Attachment1 = Attachment1

            Trail.MinLength = 0.1
            Trail.MaxLength = 4
            
            Trail.Color = color
            
        end
        
        hitbox.onTouch = function(eHum)
            if eHum.Name == "Enemy" then
                hitboxTouched = true

                eHum:TakeDamage(dmg * 2 + (dmg * i/10)) -- 50 * 2 + (50 * 5/10) if dmg = 50 and i = 5
            end
        end

        if hitboxTouched then

            local clone = RunningSlash:Clone()
            clone.Parent = AbilityHitboxFolder
            clone.CFrame = hitbox
                
            
            SlashAnimationTrack:Play()
            
            hitbox:Stop()
            hitbox:Destroy()
            
            print(i)
            break
        end

        wait(1/i) -- takes 3.81595817775 secs (3.8)
    end

    hitbox:Stop()
    hitbox:Destroy()

    Attachment0:Destroy()
    Attachment1:Destroy()
    Trail:Destroy()
    
    TweenService:Create(Humanoid, tweenInfo, {WalkSpeed = orignalWalkspeed}):Play()
    TweenService:Create(Camera, tweenInfo, {FieldOfView = originalFOV}):Play()
end)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: