I have a function that changes the friction of the parts within the map, but for some reason, the function does not work inside InputEnded...

local function ChangeFriction(State)
	for _,v in pairs(workspace.Map:GetChildren()) do
		if v:IsA("Part") or v:IsA("MeshPart") or v:IsA("UnionOperation") then 
			if State == true then
				v.CustomPhysicalProperties = PhysicalProperties.new(0.01, 0, 0, 25, 0)
			elseif State == false then
				v.CustomPhysicalProperties = PhysicalProperties.new(0.01, 0, 0, 0.3, 0)
			end
		end
	end	
end

.

uis.InputEnded:Connect(function(k)
	if k.KeyCode == Enum.KeyCode.LeftShift then --print("ended")
		workspace.Gravity = OGravity
		keypressed = false
		VelocityAdded = false

		Sliding = false

		Human.JumpPower = OJumpPower
		Human.WalkSpeed = OWalkSpeed

		SlideAnimation:Stop(0.2)
		ChangeFriction(false)
	end
end)