-- Decompiled with the Synapse X Luau decompiler.

local l__Players__1 = game:GetService("Players");
local u1 = {
	Climbing = {
		SoundId = "rbxasset://sounds/action_footsteps_plastic.mp3", 
		Looped = true
	}, 
	Died = {
		SoundId = "rbxasset://sounds/uuhhh.mp3"
	}, 
	FreeFalling = {
		SoundId = "rbxasset://sounds/action_falling.mp3", 
		Looped = true
	}, 
	GettingUp = {
		SoundId = "rbxasset://sounds/action_get_up.mp3"
	}, 
	Jumping = {
		SoundId = "rbxasset://sounds/action_jump.mp3"
	}, 
	Landing = {
		SoundId = "rbxasset://sounds/action_jump_land.mp3"
	}, 
	Running = {
		SoundId = "rbxasset://sounds/action_footsteps_plastic.mp3", 
		Looped = true, 
		Pitch = 1.85
	}, 
	Splash = {
		SoundId = "rbxasset://sounds/impact_water.mp3"
	}, 
	Swimming = {
		SoundId = "rbxasset://sounds/action_swim.mp3", 
		Looped = true, 
		Pitch = 1.6
	}
};
local function u2(p1)
	local v2 = {};
	for v3, v4 in pairs(p1) do
		v2[v3] = v4;
	end;
	return v2;
end;
local function u3(p2)
	p2.TimePosition = 0;
	p2.Playing = true;
end;
local function u4(p3, p4, p5, p6, p7)
	return (p3 - p4) * (p7 - p6) / (p5 - p4) + p6;
end;
local l__RunService__5 = game:GetService("RunService");
local function u6(...)
	local u7 = { ... };
	local u8 = Instance.new("BindableEvent");
	local function v5(...)
		for v6 = 1, #u7 do
			u7[v6]:Disconnect();
		end;
		return u8:Fire(...);
	end;
	for v7 = 1, #u7 do
		u7[v7] = u7[v7]:Connect(v5);
	end;
	return u8.Event:Wait();
end;
local function u9(p8, p9, p10)
	local v8 = {};
	for v9, v10 in pairs(u1) do
		local v11 = Instance.new("Sound");
		v11.Name = v9;
		v11.Archivable = false;
		v11.EmitterSize = 5;
		v11.MaxDistance = 150;
		v11.Volume = 0.65;
		for v12, v13 in pairs(v10) do
			v11[v12] = v13;
		end;
		v11.Parent = p10;
		v8[v9] = v11;
	end;
	local u10 = {};
	local v14 = {};
	local function u11(p11)
		for v15, v16 in pairs(u2(u10)) do
			if v15 ~= p11 then
				v15.Playing = false;
				u10[v15] = nil;
			end;
		end;
	end;
	v14[Enum.HumanoidStateType.FallingDown] = function()
		u11();
	end;
	v14[Enum.HumanoidStateType.GettingUp] = function()
		u11();
		u3(v8.GettingUp);
	end;
	v14[Enum.HumanoidStateType.Jumping] = function()
		u11();
		u3(v8.Jumping);
	end;
	v14[Enum.HumanoidStateType.Swimming] = function()
		local v17 = math.abs(p10.Velocity.Y);
		if v17 > 0.1 then
			v8.Splash.Volume = math.clamp(u4(v17, 100, 350, 0.28, 1), 0, 1);
			u3(v8.Splash);
		end;
		u11(v8.Swimming);
		v8.Swimming.Playing = true;
		u10[v8.Swimming] = true;
	end;
	v14[Enum.HumanoidStateType.Freefall] = function()
		v8.FreeFalling.Volume = 0;
		u11(v8.FreeFalling);
		u10[v8.FreeFalling] = true;
	end;
	v14[Enum.HumanoidStateType.Landed] = function()
		u11();
		local v18 = math.abs(p10.Velocity.Y);
		if v18 > 75 then
			v8.Landing.Volume = math.clamp(u4(v18, 50, 100, 0, 1), 0, 1);
			u3(v8.Landing);
		end;
	end;
	v14[Enum.HumanoidStateType.Running] = function()
		u11(v8.Running);
		v8.Running.Playing = true;
		u10[v8.Running] = true;
	end;
	v14[Enum.HumanoidStateType.Climbing] = function()
		local l__Climbing__19 = v8.Climbing;
		if math.abs(p10.Velocity.Y) > 0.1 then
			l__Climbing__19.Playing = true;
			u11(l__Climbing__19);
		else
			u11();
		end;
		u10[l__Climbing__19] = true;
	end;
	v14[Enum.HumanoidStateType.Seated] = function()
		u11();
	end;
	v14[Enum.HumanoidStateType.Dead] = function()
		u11();
		u3(v8.Died);
	end;
	local v20 = {
		[v8.Climbing] = function(p12, p13, p14)
			p13.Playing = p14.Magnitude > 0.1;
		end, 
		[v8.FreeFalling] = function(p15, p16, p17)
			if not (p17.Magnitude > 75) then
				p16.Volume = 0;
				return;
			end;
			p16.Volume = math.clamp(p16.Volume + 0.9 * p15, 0, 1);
		end
	};
	v20[v8.Running] = function(p18, p19, p20)
		local v21 = false;
		if p20.Magnitude > 0.5 then
			v21 = p9.MoveDirection.Magnitude > 0.5;
		end;
		p19.Playing = v21;
	end;
	local v22 = {
		[Enum.HumanoidStateType.RunningNoPhysics] = Enum.HumanoidStateType.Running
	};
	local u12 = v22[p9:GetState()] or p9:GetState();
	local u13 = p9.StateChanged:Connect(function(p21, p22)
		p22 = v22[p22] and p22;
		if p22 ~= u12 then
			local v23 = v14[p22];
			if v23 then
				v23();
			end;
			u12 = p22;
		end;
	end);
	local u14 = l__RunService__5.Stepped:Connect(function(p23, p24)
		for v24, v25 in pairs(u10) do
			local v26 = v20[v24];
			if v26 then
				v26(p24, v24, p10.Velocity);
			end;
		end;
	end);
	local u15 = nil;
	local u16 = nil;
	local u17 = nil;
	local function u18()
		u13:Disconnect();
		u14:Disconnect();
		u15:Disconnect();
		u16:Disconnect();
		u17:Disconnect();
	end;
	u15 = p9.AncestryChanged:Connect(function(p25, p26)
		if not p26 then
			u18();
		end;
	end);
	u16 = p10.AncestryChanged:Connect(function(p27, p28)
		if not p28 then
			u18();
		end;
	end);
	u17 = p8.CharacterAdded:Connect(u18);
end;
local function v27(p29)
	local function v28(p30)
		if not p30.Parent then
			u6(p30.AncestryChanged, p29.CharacterAdded);
		end;
		if p29.Character ~= p30 or not p30.Parent then
			return;
		end;
		local v29 = p30:FindFirstChildOfClass("Humanoid");
		while p30:IsDescendantOf(game) and not v29 do
			u6(p30.ChildAdded, p30.AncestryChanged, p29.CharacterAdded);
			v29 = p30:FindFirstChildOfClass("Humanoid");		
		end;
		if p29.Character ~= p30 or not p30:IsDescendantOf(game) then
			return;
		end;
		local v30 = p30:FindFirstChild("HumanoidRootPart");
		while p30:IsDescendantOf(game) and not v30 do
			u6(p30.ChildAdded, p30.AncestryChanged, v29.AncestryChanged, p29.CharacterAdded);
			v30 = p30:FindFirstChild("HumanoidRootPart");		
		end;
		if v30 and v29:IsDescendantOf(game) and p30:IsDescendantOf(game) and p29.Character == p30 then
			u9(p29, v29, v30);
		end;
	end;
	if p29.Character then
		v28(p29.Character);
	end;
	p29.CharacterAdded:Connect(v28);
end;
l__Players__1.PlayerAdded:Connect(v27);
for v31, v32 in ipairs(l__Players__1:GetPlayers()) do
	v27(v32);
end;