--- Skill

local UIS = game:GetService("UserInputService")
local plr = game.Players.LocalPlayer
local Mouse = plr:GetMouse()
local Debounce = true
Player = game.Players.LocalPlayer
local Track1 : Animation = script:WaitForChild("Anim01")
Track1 = Player.Character:WaitForChild("Humanoid"):LoadAnimation(script.Anim01)
local PrevWalkSpeed = nil
local Tween = game:GetService("TweenService")
local Gui = Player.PlayerGui:WaitForChild("Mochi_Skill_List".. Player.Name):WaitForChild("Frame")
local Mouse = Player:GetMouse()

local Cooldown = 15

UIS.InputBegan:Connect(function(Input)
	if Input.KeyCode == Enum.KeyCode.V and Debounce == true and Tool.Equip.Value == true and Tool.Active.Value == "None" then
		Tool.Active.Value = "4DoughBarrage"
		PrevWalkSpeed = Player.Character:WaitForChild("Humanoid").WalkSpeed
		Gui:FindFirstChild(Tool.Active.Value).Frame.Size = UDim2.new(1, 0, 1, 0)
		Player.Character:WaitForChild("Humanoid").WalkSpeed = 5
		Track1:Play()
		Track1:AdjustSpeed(0)
		wait(0.15)
		script.Fire:FireServer("hold")
	end
end)

UIS.InputEnded:Connect(function(Input)
	if Input.KeyCode == Enum.KeyCode.V and Debounce == true and Tool.Equip.Value == true and Tool.Active.Value == "4DoughBarrage" then
		Debounce = false
		Tool.Active.Value = "4DoughBarrage"
		Player.Character:WaitForChild("Humanoid").WalkSpeed = 2
		Track1:AdjustSpeed(1)
		script.Fire:FireServer("release", Mouse.Hit.p)
		local hum =  Player.Character.Humanoid
		wait(1)
		Tween:Create(Gui:FindFirstChild(Tool.Active.Value).Frame, TweenInfo.new(Cooldown), {Size = UDim2.new(0, 0, 1, 0)}):Play()
		Tool.Active.Value = "None"
		Player.Character:WaitForChild("Humanoid").WalkSpeed = PrevWalkSpeed
		wait(Cooldown)
		Debounce = true
	end
end)
