Assistant: 
User: System: You will be given a Luau script (that has been decompiled). You will rename the variables and functions to sound better, make the script more coherent, and add comments to areas of the script. Return the fixed script without adding ``` as we handle that. If no script has been given, do not produce any output. Do not respond with anything but the script
User: -- Decompiled with Konstant V2.1, a fast Luau decompiler made in Luau by plusgiant5 (https://discord.gg/wyButjTMhM)
-- Decompiled on 2024-10-06 15:16:20
-- Luau version 6, Types version 3
-- Time taken: 0.006351 seconds

local Remotes = game:GetService("ReplicatedStorage"):WaitForChild("Remotes")
local Combat_upvr = Remotes.Combat
local IkuAttacks_upvr = Remotes.IkuAttacks
local UserInputService = game:GetService("UserInputService")
local ContextActionService = game:GetService("ContextActionService")
local LocalPlayer_upvr = game:GetService("Players").LocalPlayer
local Character_upvr = LocalPlayer_upvr.Character
local Humanoid_upvr = Character_upvr.Humanoid
local var9_upvw = false
local var10_upvw = false
local function Block_upvr(arg1) -- Line 23, Named "Block"
	--[[ Upvalues[5]:
		[1]: var10_upvw (read and write)
		[2]: Character_upvr (readonly)
		[3]: Humanoid_upvr (readonly)
		[4]: var9_upvw (read and write)
		[5]: Combat_upvr (readonly)
	]]
	-- KONSTANTWARNING: Variable analysis failed. Output will have some incorrect variable assignments
	-- KONSTANTERROR: [0] 1. Error Block 1 start (CF ANALYSIS FAILED)
	var10_upvw = not var10_upvw
	-- KONSTANTERROR: [0] 1. Error Block 1 end (CF ANALYSIS FAILED)
	-- KONSTANTERROR: [5] 5. Error Block 2 start (CF ANALYSIS FAILED)
	-- KONSTANTERROR: [5] 5. Error Block 2 end (CF ANALYSIS FAILED)
	-- KONSTANTERROR: [11] 9. Error Block 35 start (CF ANALYSIS FAILED)
	if Humanoid_upvr:GetState() == Enum.HumanoidStateType.Dead or Humanoid_upvr.Sit then
		-- KONSTANTERROR: [23] 17. Error Block 6 start (CF ANALYSIS FAILED)
		do
			return
		end
		-- KONSTANTERROR: [23] 17. Error Block 6 end (CF ANALYSIS FAILED)
	end
	if not var9_upvw then
		local var34
		if var34 and arg1 ~= "Unblock" then
			var34 = nil
			for i, v in pairs(Character_upvr:GetChildren()) do
				if v:IsA("Tool") and v:FindFirstChild("Char") ~= nil then
					var34 = v:FindFirstChild("Char").Value
					local var38 = var34
				end
			end
			if Character_upvr:GetAttribute("DisableBlock") then
			else
				if var38 then
					i = {}
					v = "Block"
					i.Status = v
					i.Weapon = var38
					Combat_upvr:FireServer("Block", i)
					var9_upvw = true
					return
				end
				Combat_upvr:FireServer("Block", {
					Status = "Block";
					Weapon = "Hand";
				})
				var9_upvw = true
			end
		end
	end
	var38 = Combat_upvr
	var38 = var38:FireServer
	var38("Block", {
		Status = "UnBlock";
		Weapon = "None";
	})
	var38 = false
	var9_upvw = var38
	var38 = false
	var10_upvw = var38
	-- KONSTANTERROR: [11] 9. Error Block 35 end (CF ANALYSIS FAILED)
end
UserInputService.InputBegan:Connect(function(arg1, arg2) -- Line 96
	--[[ Upvalues[1]:
		[1]: Block_upvr (readonly)
	]]
	if not arg2 and arg1.KeyCode == Enum.KeyCode.F then
		Block_upvr("Unblock")
		Block_upvr()
	end
end)
UserInputService.InputEnded:Connect(function(arg1, arg2) -- Line 105
	--[[ Upvalues[1]:
		[1]: Block_upvr (readonly)
	]]
	if not arg2 and arg1.KeyCode == Enum.KeyCode.F then
		Block_upvr("Unblock")
	end
end)
if UserInputService.TouchEnabled and not UserInputService.KeyboardEnabled then
	ContextActionService:BindAction("BlockButton", function(arg1, arg2, arg3) -- Line 58, Named "MobileBlock"
		--[[ Upvalues[5]:
			[1]: Humanoid_upvr (readonly)
			[2]: var10_upvw (read and write)
			[3]: var9_upvw (read and write)
			[4]: Character_upvr (readonly)
			[5]: Combat_upvr (readonly)
		]]
		if Humanoid_upvr:GetState() == Enum.HumanoidStateType.Dead or Humanoid_upvr.Sit then
		else
			if arg2 == Enum.UserInputState.Begin then
				var10_upvw = true
			elseif arg2 == Enum.UserInputState.End then
				var10_upvw = false
			end
			if not var9_upvw and var10_upvw then
				local var55
				if not var55 then
					var55 = nil
					for i_2, v_2 in pairs(Character_upvr:GetChildren()) do
						if v_2:IsA("Tool") and v_2:FindFirstChild("Char") then
							var55 = v_2:FindFirstChild("Char").Value
						end
					end
					if Character_upvr:GetAttribute("DisableBlock") then
					else
						if var55 then
							i_2 = {}
							v_2 = "Block"
							i_2.Status = v_2
							i_2.Weapon = var55
							Combat_upvr:FireServer("Block", i_2)
							var9_upvw = true
							return
						end
						Combat_upvr:FireServer("Block", {
							Status = "Block";
							Weapon = "Hand";
						})
						var9_upvw = true
					end
				end
			end
			if not var10_upvw then
				Combat_upvr:FireServer("Block", {
					Status = "UnBlock";
					Weapon = "None";
				})
				var9_upvw = false
				var10_upvw = false
			end
		end
	end, true, Enum.KeyCode.F)
	ContextActionService:SetPosition("BlockButton", UDim2.new(0.3, 0, 0.7, 0))
	ContextActionService:SetTitle("BlockButton", "Block")
	local any_GetButton_result1 = ContextActionService:GetButton("BlockButton")
	any_GetButton_result1.SizeConstraint = Enum.SizeConstraint.RelativeYY
	any_GetButton_result1.Size = UDim2.new(0.25, 0, 0.25, 0)
	local ActionTitle = any_GetButton_result1.ActionTitle
	ActionTitle.TextScaled = true
	ActionTitle.TextWrapped = true
end
local CurrentChar_upvr = Character_upvr:WaitForChild("CurrentChar")
local YoumuAttacks_upvr = Remotes.YoumuAttacks
local KokoroAttacks_upvr = Remotes.KokoroAttacks
local CirnoAttacks_upvr = Remotes.CirnoAttacks
local function SwapWeapon_upvr() -- Line 127, Named "SwapWeapon"
	--[[ Upvalues[6]:
		[1]: Character_upvr (readonly)
		[2]: Humanoid_upvr (readonly)
		[3]: CurrentChar_upvr (readonly)
		[4]: YoumuAttacks_upvr (readonly)
		[5]: KokoroAttacks_upvr (readonly)
		[6]: CirnoAttacks_upvr (readonly)
	]]
	if Character_upvr:FindFirstChild("DisableTool").Value == true or Humanoid_upvr:GetState() == Enum.HumanoidStateType.Dead or Humanoid_upvr.Sit then
	else
		if CurrentChar_upvr.Value == "Youmu" then
			YoumuAttacks_upvr:FireServer("SwapWeapon")
			return
		end
		if CurrentChar_upvr.Value == "Kokoro" then
			KokoroAttacks_upvr:FireServer("SwapEmotion")
			return
		end
		if CurrentChar_upvr.Value == "Cirno" then
			CirnoAttacks_upvr:FireServer("SwapWeapon")
		end
	end
end
local ReisenAttacks_upvr = Remotes.ReisenAttacks
local TenshiAttacks_upvr = Remotes.TenshiAttacks
local PatchouliAttacks_upvr = Remotes.PatchouliAttacks
UserInputService.InputBegan:Connect(function(arg1, arg2) -- Line 139
	--[[ Upvalues[5]:
		[1]: SwapWeapon_upvr (readonly)
		[2]: IkuAttacks_upvr (readonly)
		[3]: ReisenAttacks_upvr (readonly)
		[4]: TenshiAttacks_upvr (readonly)
		[5]: PatchouliAttacks_upvr (readonly)
	]]
	if not arg2 then
		if arg1.KeyCode == Enum.KeyCode.E then
			SwapWeapon_upvr()
			IkuAttacks_upvr:FireServer("ToggleDash")
			return
		end
		if arg1.KeyCode == Enum.KeyCode.R then
			ReisenAttacks_upvr:FireServer("Reload")
			TenshiAttacks_upvr:FireServer("Recharge")
			IkuAttacks_upvr:FireServer("Charge", "Start")
			PatchouliAttacks_upvr:FireServer("Exchange")
		end
	end
end)
UserInputService.InputEnded:Connect(function(arg1, arg2) -- Line 153
	--[[ Upvalues[1]:
		[1]: IkuAttacks_upvr (readonly)
	]]
	if not arg2 and arg1.KeyCode == Enum.KeyCode.R then
		IkuAttacks_upvr:FireServer("Charge", "End")
	end
end)
Character_upvr.DescendantAdded:Connect(function(arg1) -- Line 161
	--[[ Upvalues[1]:
		[1]: LocalPlayer_upvr (readonly)
	]]
	if arg1:IsA("BodyGyro") and arg1.Name ~= "卍" then
		LocalPlayer_upvr:Kick("")
	end
end)
Assistant:
Assistant: