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-04 18:26:47
-- Luau version 6, Types version 3
-- Time taken: 0.001944 seconds

print("local enabled")
local tbl_upvr = {}
for _, v in pairs(game.ReplicatedStorage.Effects:GetChildren()) do
	tbl_upvr[v.Name] = require(v)
end
game.Lighting.Dead.Enabled = false
local LocalPlayer_upvr = game:GetService("Players").LocalPlayer
local function _() -- Line 18, Named "ragdoll"
	--[[ Upvalues[1]:
		[1]: LocalPlayer_upvr (readonly)
	]]
	local Character_2 = LocalPlayer_upvr.Character
	if Character_2 then
		Character_2 = LocalPlayer_upvr.Character:FindFirstChild("Humanoid")
	end
	if not Character_2 then
	else
		Character_2.BreakJointsOnDeath = false
		Character_2.RequiresNeck = false
		Character_2:ChangeState(Enum.HumanoidStateType.Physics)
	end
end
local function _() -- Line 29, Named "unragdoll"
	--[[ Upvalues[1]:
		[1]: LocalPlayer_upvr (readonly)
	]]
	local Character = LocalPlayer_upvr.Character
	if Character then
		Character = LocalPlayer_upvr.Character:FindFirstChild("Humanoid")
	end
	if not Character then
	else
		Character:ChangeState(Enum.HumanoidStateType.GettingUp)
		Character.BreakJointsOnDeath = true
		Character.RequiresNeck = true
	end
end
game.ReplicatedStorage:WaitForChild("RagdollClient").OnClientEvent:Connect(function(arg1) -- Line 40
	--[[ Upvalues[1]:
		[1]: LocalPlayer_upvr (readonly)
	]]
	print("got local state "..arg1)
	local var13
	if arg1 == "ragdoll" then
		var13 = LocalPlayer_upvr.Character
		if var13 then
			var13 = LocalPlayer_upvr.Character:FindFirstChild("Humanoid")
		end
		if not var13 then
		else
			var13.BreakJointsOnDeath = false
			var13.RequiresNeck = false
			var13:ChangeState(Enum.HumanoidStateType.Physics)
		end
	end
	if arg1 == "unragdoll" then
		if LocalPlayer_upvr.Character then
		end
		if not LocalPlayer_upvr.Character:FindFirstChild("Humanoid") then return end
		LocalPlayer_upvr.Character:FindFirstChild("Humanoid"):ChangeState(Enum.HumanoidStateType.GettingUp)
		-- KONSTANTERROR: Expression was reused, decompilation is incorrect
		LocalPlayer_upvr.Character:FindFirstChild("Humanoid").BreakJointsOnDeath = true
		-- KONSTANTERROR: Expression was reused, decompilation is incorrect
		LocalPlayer_upvr.Character:FindFirstChild("Humanoid").RequiresNeck = true
	end
end)
local tbl_upvr_2 = {}
function _G.playEffect(arg1) -- Line 47
	--[[ Upvalues[2]:
		[1]: tbl_upvr (readonly)
		[2]: tbl_upvr_2 (readonly)
	]]
	if tbl_upvr[arg1] and (not tbl_upvr_2[arg1] or 0.1 <= tick() - tbl_upvr_2[arg1]) then
		tbl_upvr_2[arg1] = tick()
		tbl_upvr[arg1].play()
	end
end
game.ReplicatedStorage:WaitForChild("PlayEffect").OnClientEvent:Connect(function(arg1) -- Line 54
	--[[ Upvalues[1]:
		[1]: tbl_upvr (readonly)
	]]
	if tbl_upvr[arg1] then
		tbl_upvr[arg1].play()
		return
	end
end)
Assistant:
Assistant: